├── README.md ├── .gitignore ├── src └── main │ ├── resources │ ├── YC.properties │ ├── YX.properties │ ├── cause.properties │ ├── rabbitmq.properties │ ├── typeId.properties │ ├── log4j.properties │ ├── database.properties │ ├── yx.json │ └── yc.json │ └── java │ └── com │ └── visenergy │ └── iec104 │ ├── IeQuality.java │ ├── IeQualifierOfInterrogation.java │ ├── IeSinglePointWithQuality.java │ ├── InformationElement.java │ ├── IeShortFloat.java │ ├── Init.java │ ├── util │ ├── FileUtils.java │ ├── RabbitMqUtils.java │ └── ChangeUtils.java │ ├── IeAbstractQuality.java │ ├── DataProcessPool.java │ ├── Test.java │ ├── InformationObject.java │ ├── Apdu.java │ ├── YxStatusObject.java │ ├── Asdu.java │ ├── ServerTest.java │ ├── YxObject.java │ ├── GenerateYxStatus.java │ ├── Client.java │ └── YcObject.java └── pom.xml /README.md: -------------------------------------------------------------------------------- 1 | # IEC104 2 | 用于与光伏之间进行通信 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | .idea 3 | IEC104.iml 4 | target 5 | logs/ 6 | -------------------------------------------------------------------------------- /src/main/resources/YC.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huarda/IEC104-1/HEAD/src/main/resources/YC.properties -------------------------------------------------------------------------------- /src/main/resources/YX.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huarda/IEC104-1/HEAD/src/main/resources/YX.properties -------------------------------------------------------------------------------- /src/main/resources/cause.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huarda/IEC104-1/HEAD/src/main/resources/cause.properties -------------------------------------------------------------------------------- /src/main/resources/rabbitmq.properties: -------------------------------------------------------------------------------- 1 | host=rabbitmq 2 | port=5672 3 | username=admin 4 | password=123456 5 | virtualhost=/ -------------------------------------------------------------------------------- /src/main/resources/typeId.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huarda/IEC104-1/HEAD/src/main/resources/typeId.properties -------------------------------------------------------------------------------- /src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | #根日志配置,级别是info,控制台输出 2 | log4j.rootLogger=debug,stdout,file 3 | #控制台输出格式 4 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 5 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.stdout.layout.conversionPattern=%5p %d [%t] - %m%n 7 | #文件输出格式 8 | log4j.appender.file=org.apache.log4j.DailyRollingFileAppender 9 | log4j.appender.file.File=logs/flying_ 10 | log4j.appender.file.DatePattern=yyyy-MM-dd'.log' 11 | log4j.appender.file.MaxFileSize=10MB 12 | log4j.appender.file.MaxBackupIndex=0 13 | log4j.appender.file.layout=org.apache.log4j.SimpleLayout 14 | log4j.appender.file.layout.ConversionPattern=[ssh] %p %t %c - %m%n 15 | # -------------------------------------------------------------------------------- /src/main/resources/database.properties: -------------------------------------------------------------------------------- 1 | !oracle 2 | !driver=oracle.jdbc.driver.OracleDriver 3 | !url=jdbc:oracle:thin:@27.17.26.93:1521:ORCL 4 | !url=jdbc:oracle:thin:@localhost:1521:ORCL 5 | !username=szhd 6 | !password=szhd 7 | 8 | !sql server 9 | !driver=net.sourceforge.jtds.jdbc.Driver 10 | !url=jdbc:jtds:sqlserver://192.168.88.157:1433/Dsideal_Training_DB 11 | !username=sa 12 | !password=dsideal 13 | 14 | !mysql 15 | driver=com.mysql.jdbc.Driver 16 | url=jdbc:mysql://mysql:3306/emanagenew?useUnicode=true&characterEncoding=UTF-8&useSSL=false 17 | username=root 18 | password=123456 19 | !url=jdbc:mysql://192.168.210.4:3306/guankoustation?useUnicode=true&characterEncoding=UTF-8 20 | !username=visDB1 21 | !password=Visenergy2015 22 | -------------------------------------------------------------------------------- /src/main/java/com/visenergy/iec104/IeQuality.java: -------------------------------------------------------------------------------- 1 | package com.visenergy.iec104; 2 | 3 | import java.io.DataInputStream; 4 | import java.io.IOException; 5 | 6 | /** 7 | * 品质描述 8 | * 9 | */ 10 | public class IeQuality extends IeAbstractQuality { 11 | 12 | public IeQuality(boolean overflow, boolean blocked, boolean substituted, boolean notTopical, boolean invalid) { 13 | super(blocked, substituted, notTopical, invalid); 14 | 15 | if (overflow) { 16 | value |= 0x01; 17 | } 18 | } 19 | 20 | IeQuality(DataInputStream is) throws IOException { 21 | super(is); 22 | } 23 | 24 | public boolean isOverflow() { 25 | return (value & 0x01) == 0x01; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return "品质描述, 溢出: " + isOverflow() + ", " + super.toString(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/visenergy/iec104/IeQualifierOfInterrogation.java: -------------------------------------------------------------------------------- 1 | package com.visenergy.iec104; 2 | 3 | import java.io.DataInputStream; 4 | import java.io.IOException; 5 | 6 | public class IeQualifierOfInterrogation extends InformationElement { 7 | 8 | private final int value; 9 | 10 | public IeQualifierOfInterrogation(int value) { 11 | this.value = value; 12 | } 13 | 14 | public IeQualifierOfInterrogation(DataInputStream is) throws IOException { 15 | value = (is.readByte() & 0xff); 16 | } 17 | 18 | @Override 19 | public int encode(byte[] buffer, int i) { 20 | buffer[i] = (byte) value; 21 | return 1; 22 | } 23 | 24 | public int getValue() { 25 | return value; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return "Qualifier of interrogation: " + value; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/visenergy/iec104/IeSinglePointWithQuality.java: -------------------------------------------------------------------------------- 1 | package com.visenergy.iec104; 2 | 3 | import java.io.DataInputStream; 4 | import java.io.IOException; 5 | 6 | /** 7 | * 单点信息 8 | * 9 | */ 10 | public class IeSinglePointWithQuality extends IeAbstractQuality { 11 | 12 | public IeSinglePointWithQuality(boolean on, boolean blocked, boolean substituted, boolean notTopical, 13 | boolean invalid) { 14 | super(blocked, substituted, notTopical, invalid); 15 | 16 | if (on) { 17 | value |= 0x01; 18 | } 19 | } 20 | 21 | public IeSinglePointWithQuality(DataInputStream is) throws IOException { 22 | super(is); 23 | } 24 | 25 | public boolean isOn() { 26 | return (value & 0x01) == 0x01; 27 | } 28 | 29 | @Override 30 | public String toString() { 31 | return "单点, 是否开闸: " + isOn() + ", " + super.toString(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/visenergy/iec104/InformationElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-17 Fraunhofer ISE 3 | * 4 | * This file is part of j60870. 5 | * For more information visit http://www.openmuc.org 6 | * 7 | * j60870 is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * j60870 is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with j60870. If not, see . 19 | * 20 | */ 21 | package com.visenergy.iec104; 22 | 23 | public abstract class InformationElement { 24 | 25 | public abstract int encode(byte[] buffer, int i); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/visenergy/iec104/IeShortFloat.java: -------------------------------------------------------------------------------- 1 | package com.visenergy.iec104; 2 | 3 | import java.io.DataInputStream; 4 | import java.io.IOException; 5 | 6 | /** 7 | * 类型标识,测量值,短浮点数 8 | * 遥测 9 | */ 10 | public class IeShortFloat extends InformationElement { 11 | 12 | private final float value; 13 | 14 | public IeShortFloat(float value) { 15 | this.value = value; 16 | } 17 | 18 | public IeShortFloat(DataInputStream is) throws IOException { 19 | value = Float.intBitsToFloat((is.readByte() & 0xff) | ((is.readByte() & 0xff) << 8) 20 | | ((is.readByte() & 0xff) << 16) | ((is.readByte() & 0xff) << 24)); 21 | } 22 | 23 | @Override 24 | public int encode(byte[] buffer, int i) { 25 | 26 | int tempVal = Float.floatToIntBits(value); 27 | buffer[i++] = (byte) tempVal; 28 | buffer[i++] = (byte) (tempVal >> 8); 29 | buffer[i++] = (byte) (tempVal >> 16); 30 | buffer[i] = (byte) (tempVal >> 24); 31 | 32 | return 4; 33 | } 34 | 35 | public float getValue() { 36 | return value; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return "短浮点数值: " + value; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/visenergy/iec104/Init.java: -------------------------------------------------------------------------------- 1 | package com.visenergy.iec104; 2 | 3 | import com.flying.jdbc.SqlHelper; 4 | import com.flying.jdbc.util.DBConnectionPool; 5 | import com.visenergy.iec104.util.FileUtils; 6 | import net.sf.json.JSONObject; 7 | import org.apache.commons.logging.Log; 8 | import org.apache.commons.logging.LogFactory; 9 | 10 | import java.util.Properties; 11 | 12 | /** 13 | * Created by Administrator on 2017/7/25 0025. 14 | */ 15 | public class Init { 16 | private static Log log = LogFactory.getLog(Init.class); 17 | 18 | public static Properties typeIdProp = null; 19 | public static Properties causeProp = null; 20 | public static JSONObject ycJsonObj = null; 21 | public static JSONObject yxJsonObj = null; 22 | 23 | public static void start(){ 24 | initDb(); 25 | initBusinessData(); 26 | DataProcessPool.initPool(); 27 | } 28 | 29 | public static void initDb(){ 30 | log.debug("建立数据库连接池,连接数量是10"); 31 | SqlHelper.connPool = new DBConnectionPool(10); 32 | } 33 | 34 | public static void initBusinessData(){ 35 | try { 36 | log.debug("解析配置文件"); 37 | typeIdProp = FileUtils.loadPropFile("typeId.properties"); 38 | causeProp = FileUtils.loadPropFile("cause.properties"); 39 | ycJsonObj = FileUtils.loadJsonFile("yc.json"); 40 | yxJsonObj = FileUtils.loadJsonFile("yx.json"); 41 | } catch (Exception e) { 42 | e.printStackTrace(); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/visenergy/iec104/util/FileUtils.java: -------------------------------------------------------------------------------- 1 | package com.visenergy.iec104.util; 2 | 3 | import net.sf.json.JSONObject; 4 | 5 | import java.io.BufferedReader; 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | import java.io.InputStreamReader; 9 | import java.util.Properties; 10 | 11 | /** 12 | * Created by Fuxudong on 2017-6-12. 13 | * @Description 加载property配置文件 14 | */ 15 | public class FileUtils { 16 | public static Properties loadPropFile(String filePath) throws Exception{ 17 | InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(filePath); 18 | InputStreamReader isr = new InputStreamReader(is, "GBK"); 19 | Properties properties = new Properties(); 20 | try { 21 | properties.load(isr); 22 | }catch (IOException ex){ 23 | ex.printStackTrace(); 24 | }finally { 25 | is.close(); 26 | isr.close(); 27 | } 28 | return properties; 29 | } 30 | 31 | public static JSONObject loadJsonFile(String filePath) throws Exception{ 32 | InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(filePath); 33 | BufferedReader br = new BufferedReader(new InputStreamReader(is, "UTF-8")); 34 | StringBuffer jsonStrBuff = new StringBuffer(); 35 | String brStr = null; 36 | while ((brStr =br.readLine()) != null){ 37 | jsonStrBuff.append(brStr); 38 | } 39 | return JSONObject.fromObject(jsonStrBuff.toString()); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/visenergy/iec104/IeAbstractQuality.java: -------------------------------------------------------------------------------- 1 | package com.visenergy.iec104; 2 | 3 | import java.io.DataInputStream; 4 | import java.io.IOException; 5 | 6 | /** 7 | * 品质描述 8 | */ 9 | abstract class IeAbstractQuality extends InformationElement { 10 | 11 | protected int value; 12 | 13 | public IeAbstractQuality(boolean blocked, boolean substituted, boolean notTopical, boolean invalid) { 14 | 15 | value = 0; 16 | 17 | if (blocked) { 18 | value |= 0x10; 19 | } 20 | if (substituted) { 21 | value |= 0x20; 22 | } 23 | if (notTopical) { 24 | value |= 0x40; 25 | } 26 | if (invalid) { 27 | value |= 0x80; 28 | } 29 | 30 | } 31 | 32 | public IeAbstractQuality(DataInputStream is) throws IOException { 33 | value = (is.readByte() & 0xff); 34 | } 35 | 36 | @Override 37 | public int encode(byte[] buffer, int i) { 38 | buffer[i] = (byte) value; 39 | return 1; 40 | } 41 | 42 | public boolean isBlocked() { 43 | return (value & 0x10) == 0x10; 44 | } 45 | 46 | public boolean isSubstituted() { 47 | return (value & 0x20) == 0x20; 48 | } 49 | 50 | public boolean isNotTopical() { 51 | return (value & 0x40) == 0x40; 52 | } 53 | 54 | public boolean isInvalid() { 55 | return (value & 0x80) == 0x80; 56 | } 57 | 58 | @Override 59 | public String toString() { 60 | return "被封锁: " + isBlocked() + ", 被取代: " + isSubstituted() + ", 非当前值: " + isNotTopical() 61 | + ", 是否有效: " + isInvalid(); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/visenergy/iec104/DataProcessPool.java: -------------------------------------------------------------------------------- 1 | package com.visenergy.iec104; 2 | 3 | import com.flying.jdbc.SqlHelper; 4 | import com.flying.jdbc.data.CommandType; 5 | import com.flying.jdbc.util.DBConnection; 6 | import org.apache.commons.logging.Log; 7 | import org.apache.commons.logging.LogFactory; 8 | 9 | import java.util.HashMap; 10 | import java.util.List; 11 | import java.util.Map; 12 | 13 | /** 14 | * Created by zhonghuan on 2017/7/25. 15 | */ 16 | public class DataProcessPool { 17 | private static Log log = LogFactory.getLog(DataProcessPool.class); 18 | 19 | public static Map ycPool = new HashMap(); 20 | public static Map yxPool = new HashMap(); 21 | public static Map yxsPool = new HashMap(); 22 | 23 | 24 | public static void initPool(){ 25 | log.debug("初始化对象池对象"); 26 | DBConnection conn = SqlHelper.connPool.getConnection(); 27 | try { 28 | //查询所有逆变器的序列号、ID、所属楼宇ID 29 | String sql = "SELECT A.INVERTER_ID,A.SERIAL,A.BUILDING_ID FROM T_PVMANAGE_INVERTER A"; 30 | List list = SqlHelper.executeQuery(conn,CommandType.Text,sql); 31 | for (int i = 0; i< list.size();i++){ 32 | log.debug("创建逆变器" + list.get(i).get("SERIAL") + "遥信、遥测对象。"); 33 | ycPool.put((String) list.get(i).get("SERIAL"),new YcObject((String) list.get(i).get("INVERTER_ID"),(String) list.get(i).get("SERIAL"))); 34 | yxsPool.put((String) list.get(i).get("SERIAL"),new YxStatusObject((String) list.get(i).get("INVERTER_ID"),(String) list.get(i).get("SERIAL"))); 35 | } 36 | } catch (Exception e) { 37 | e.printStackTrace(); 38 | } 39 | SqlHelper.connPool.releaseConnection(conn); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/visenergy/iec104/Test.java: -------------------------------------------------------------------------------- 1 | package com.visenergy.iec104; 2 | 3 | import com.visenergy.iec104.util.ChangeUtils; 4 | import com.visenergy.iec104.util.FileUtils; 5 | import net.sf.json.JSONObject; 6 | import org.apache.commons.logging.Log; 7 | import org.apache.commons.logging.LogFactory; 8 | 9 | import java.io.ByteArrayInputStream; 10 | import java.io.DataInputStream; 11 | import java.util.Properties; 12 | 13 | /** 14 | * Created by Fuxdong on 2017-5-8. 15 | */ 16 | public class Test { 17 | private static Log log = LogFactory.getLog(Test.class); 18 | 19 | public static void main(String[] args) throws Exception{ 20 | // String text = new String("68 08 02 00 00 00 0A C0 01 00 00 00"); 21 | 22 | // String text = new String("68 7A FC 13 7C 00 0D 0E 03 00 01 00 3A 41 00 85 EB 47 42 00 3B 41 00 D7 A6 01 46 00 3C 41 00 14 AE B5 41 00 3D 41 00 EB 51 E0 40 00 3E 41 00 C2 F5 E0 40 00 3F 41 00 AE 47 E1 40 00 40 41 00 5C 4F 6E 43 00 41 41 00 C2 35 6C 43 00 42 41 00 D7 63 6B 43 00 45 41 00 00 00 C5 42 00 46 41 00 48 E1 DA 3F 00 47 41 00 B1 72 D8 3F 00 48 41 00 CB A1 D5 3F 00 49 41 00 96 43 A3 40 00"); 23 | /* String text = new String("68 E2 20 00 00 00 0D 1B 03 00 01 00 46 40 00 9A 99 CD 43 00 47 40 00 33 F3 CC 43 00 4A 40 00 33 B3 6E 43 00 4E 40 00 3D 0A 48 42 00 4F 40 00 3A B4 CC C0 00 54 40 00 E8 FB B5 41 00 56 40 00 69 91 B8 41 00 58 40 00 66 66 12 41 00 59 40 00 C2 75 44 43 00 5A 40 00 52 90 13 45 00 5B 40 00 D7 AA C5 46 00 5C 40 00 D7 AA C5 46 00 70 40 00 33 33 B3 3F 00 5D 40 00 33 33 16 44 00 5E 40 00 67 66 B6 40 00 5F 40 00 33 33 16 44 00 60 40 00 33 33 B3 40 00 04 40 00 C2 8B C3 46 00 09 40 00 CD EC 16 44 00 0A 40 00 33 33 B3 40 00 0B 40 00 CD EC 16 44 00 0C 40 00 CD CC AC 40 00 0D 40 00 CD CC 16 44 00 0E 40 00 00 00 B0 40 00 0F 40 00 CD CC 16 44 00 10 40 00 00 00 B0 40 00 11 40 00 CD 4C CE 43 00"); 24 | String[] s = text.trim().split(" "); 25 | byte[] bytes = new byte[255]; 26 | for (int i=0;i127){ 29 | bytes[i] = (byte) a; 30 | }else { 31 | bytes[i]= Byte.parseByte(s[i],16); 32 | } 33 | } 34 | DataInputStream dis = new DataInputStream(new ByteArrayInputStream(bytes)); 35 | Apdu apdu = new Apdu(dis); 36 | */ 37 | IeShortFloat isf = new IeShortFloat(557.5f); 38 | byte[] b = new byte[4]; 39 | isf.encode(b,0); 40 | System.out.println(String.format("%02d",ChangeUtils.toHexString(b))); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/visenergy/iec104/util/RabbitMqUtils.java: -------------------------------------------------------------------------------- 1 | package com.visenergy.iec104.util; 2 | 3 | import com.rabbitmq.client.*; 4 | 5 | import java.io.IOException; 6 | import java.util.Properties; 7 | import java.util.concurrent.TimeoutException; 8 | 9 | /** 10 | * Created by Administrator on 2017/8/23 0023. 11 | */ 12 | public class RabbitMqUtils { 13 | private static String USERNAME = "test"; 14 | private static String PASSWORD = "123456"; 15 | private static String HOST = "192.168.100.100"; 16 | private static int PORT = 5672; 17 | private static String VIRTUAL_HOST = "/"; 18 | 19 | static{ 20 | try { 21 | Properties rabbitProp = FileUtils.loadPropFile("rabbitmq.properties"); 22 | if(!"".equals(rabbitProp.getProperty("username"))){ 23 | USERNAME = rabbitProp.getProperty("username"); 24 | } 25 | if(!"".equals(rabbitProp.getProperty("password"))){ 26 | PASSWORD = rabbitProp.getProperty("password"); 27 | } 28 | if(!"".equals(rabbitProp.getProperty("host"))){ 29 | HOST = rabbitProp.getProperty("host"); 30 | } 31 | if(!"".equals(rabbitProp.getProperty("port"))){ 32 | PORT = Integer.parseInt(rabbitProp.getProperty("port")); 33 | } 34 | if(!"".equals(rabbitProp.getProperty("virtualhost"))){ 35 | VIRTUAL_HOST = rabbitProp.getProperty("virtualhost"); 36 | } 37 | } catch (Exception e) { 38 | e.printStackTrace(); 39 | } 40 | } 41 | 42 | /** 43 | * 建立rabbitMq连接 44 | * @return 45 | * @throws IOException 46 | * @throws TimeoutException 47 | */ 48 | public static Connection newConnection() throws IOException, TimeoutException { 49 | ConnectionFactory factory = new ConnectionFactory(); 50 | factory.setUsername(USERNAME); 51 | factory.setPassword(PASSWORD); 52 | factory.setHost(HOST); 53 | factory.setVirtualHost(VIRTUAL_HOST); 54 | factory.setPort(PORT); 55 | 56 | return factory.newConnection(); 57 | } 58 | 59 | /** 60 | * 创建rabbitMq通道 61 | * @return 62 | * @throws IOException 63 | * @throws TimeoutException 64 | */ 65 | public static Channel createRabbitMqChannel(Connection conn) throws IOException, TimeoutException { 66 | return conn.createChannel(); 67 | } 68 | 69 | public static void sendMq(Channel channel,String queueName,String message) throws IOException, TimeoutException { 70 | channel.queueDeclare(queueName,false,false,false,null); 71 | 72 | channel.basicPublish("",queueName,null,message .getBytes()); 73 | } 74 | 75 | public static void receiveMq(Channel channel,String queueName) throws IOException, TimeoutException { 76 | Consumer consumer = new DefaultConsumer(channel){ 77 | @Override 78 | public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException { 79 | String message = new String(body,"UTF-8"); 80 | System.out.println("Received:" + message); 81 | } 82 | }; 83 | channel.basicConsume(queueName,true,consumer); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.visenergy 8 | IEC104 9 | 1.0.0 10 | 11 | 12 | 13 | junit 14 | junit 15 | 4.8.2 16 | 17 | 18 | log4j 19 | log4j 20 | 1.2.17 21 | 22 | 23 | net.sf.json-lib 24 | json-lib 25 | 2.3 26 | jdk15 27 | 28 | 29 | com.flying 30 | vis-jdbc 31 | 1.0-SNAPSHOT 32 | 33 | 34 | mysql 35 | mysql-connector-java 36 | 5.1.38 37 | 38 | 39 | com.rabbitmq 40 | amqp-client 41 | 4.2.0 42 | 43 | 44 | org.slf4j 45 | slf4j-simple 46 | 1.7.7 47 | 48 | 49 | 50 | 51 | 52 | org.apache.maven.plugins 53 | maven-compiler-plugin 54 | 3.1 55 | 56 | 1.8 57 | 1.8 58 | UTF-8 59 | 60 | 61 | 62 | org.apache.maven.plugins 63 | maven-assembly-plugin 64 | 2.5.5 65 | 66 | false 67 | 68 | 69 | com.visenergy.iec104.Client 70 | 71 | 72 | 73 | jar-with-dependencies 74 | 75 | 76 | 77 | 78 | make-assembly 79 | package 80 | 81 | single 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /src/main/java/com/visenergy/iec104/InformationObject.java: -------------------------------------------------------------------------------- 1 | package com.visenergy.iec104; 2 | 3 | import java.io.DataInputStream; 4 | import java.io.IOException; 5 | 6 | 7 | /** 8 | *信息体对象 9 | * 10 | */ 11 | public class InformationObject { 12 | 13 | private int informationObjectAddress; 14 | private final InformationElement[][] informationElements; 15 | 16 | public InformationObject(int informationObjectAddress, InformationElement[][] informationElements) { 17 | this.informationObjectAddress = informationObjectAddress; 18 | this.informationElements = informationElements; 19 | } 20 | 21 | public InformationObject(DataInputStream is, int typeId, int numberOfSequenceElements) 22 | throws IOException { 23 | 24 | this.informationObjectAddress = (is.readByte() & 0xff) + ((is.readByte() & 0xff) << 8) 25 | + ((is.readByte() & 0xff) << 16); 26 | 27 | switch (typeId) { 28 | // 1 单点遥信 29 | case 1: 30 | informationElements = new InformationElement[numberOfSequenceElements][1]; 31 | for (int i = 0; i < numberOfSequenceElements; i++) { 32 | informationElements[i][0] = new IeSinglePointWithQuality(is); 33 | 34 | } 35 | break; 36 | // 13 浮点型遥测 37 | case 13: 38 | informationElements = new InformationElement[numberOfSequenceElements][2]; 39 | for (int i = 0; i < numberOfSequenceElements; i++) { 40 | informationElements[i][0] = new IeShortFloat(is); 41 | informationElements[i][1] = new IeQuality(is); 42 | } 43 | break; 44 | // 100 总召 45 | case 100: 46 | informationElements = new InformationElement[][] { { new IeQualifierOfInterrogation(is) } }; 47 | break; 48 | 49 | default: 50 | throw new IOException( 51 | "无法转换信息对象,由于类型标识未知: " + typeId); 52 | } 53 | 54 | } 55 | 56 | public int encode(byte[] buffer, int i) { 57 | int origi = i; 58 | 59 | buffer[i++] = (byte) informationObjectAddress; 60 | 61 | buffer[i++] = (byte) (informationObjectAddress >> 8); 62 | 63 | buffer[i++] = (byte) (informationObjectAddress >> 16); 64 | 65 | 66 | for (InformationElement[] informationElementCombination : informationElements) { 67 | for (InformationElement informationElement : informationElementCombination) { 68 | i += informationElement.encode(buffer, i); 69 | } 70 | } 71 | 72 | return i - origi; 73 | } 74 | 75 | public int getInformationObjectAddress() { 76 | return informationObjectAddress; 77 | } 78 | 79 | /** 80 | * 信息元素 81 | * 82 | * @return 信息元素二维数组. 83 | */ 84 | public InformationElement[][] getInformationElements() { 85 | return informationElements; 86 | } 87 | 88 | @Override 89 | public String toString() { 90 | 91 | StringBuilder builder = new StringBuilder("IOA: " + informationObjectAddress); 92 | 93 | if (informationElements.length > 1) { 94 | int i = 1; 95 | for (InformationElement[] informationElementSet : informationElements) { 96 | builder.append("\n信息体元素集 " + i + ":"); 97 | for (InformationElement informationElement : informationElementSet) { 98 | builder.append("\n"); 99 | builder.append(informationElement.toString()); 100 | } 101 | i++; 102 | } 103 | } 104 | else { 105 | for (InformationElement[] informationElementSet : informationElements) { 106 | for (InformationElement informationElement : informationElementSet) { 107 | builder.append("\n"); 108 | builder.append(informationElement.toString()); 109 | } 110 | } 111 | } 112 | 113 | return builder.toString(); 114 | 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /src/main/java/com/visenergy/iec104/Apdu.java: -------------------------------------------------------------------------------- 1 | package com.visenergy.iec104; 2 | 3 | import org.apache.commons.logging.Log; 4 | import org.apache.commons.logging.LogFactory; 5 | 6 | import java.io.DataInputStream; 7 | import java.io.IOException; 8 | 9 | /** 10 | * Created by Fuxdong on 2017-5-9. 11 | */ 12 | public class Apdu { 13 | private Log log = LogFactory.getLog(Apdu.class); 14 | 15 | private int sendSeqNum = 0; 16 | private int receiveSeqNum = 0; 17 | private ApciType apciType; 18 | private Asdu asdu = null; 19 | 20 | //枚举,APCI类型,即I帧,S帧,U帧 21 | public enum ApciType { 22 | I_FORMAT, //I帧 23 | S_FORMAT, //S帧 24 | TESTFR_CON, //U帧,测试确认 25 | TESTFR_ACT, //U帧,测试命令 26 | STOPDT_CON, //U帧,停止确认 27 | STOPDT_ACT, //U帧,停止命令 28 | STARTDT_CON, //U帧,启动确认 29 | STARTDT_ACT //U帧,启动命令 30 | } 31 | 32 | public Apdu(){} 33 | 34 | public Apdu(int sendSeqNum, int receiveSeqNum, ApciType apciType, Asdu asdu) { 35 | this.sendSeqNum = sendSeqNum; 36 | this.receiveSeqNum = receiveSeqNum; 37 | this.apciType = apciType; 38 | this.asdu = asdu; 39 | } 40 | 41 | public Apdu(DataInputStream dis) throws Exception { 42 | int start = dis.readByte() & 0xff; 43 | int len = dis.readByte() & 0xff; 44 | log.debug("启动帧:" + Integer.toHexString(start)); 45 | log.debug("APDU长度:" + len); 46 | byte[] controlFields = new byte[4]; 47 | if(start != 104 ){ 48 | log.error(new IllegalArgumentException("启动帧错误")); 49 | }else if(len < 4 || len >253){ 50 | log.error(new IllegalArgumentException("帧长度有误")); 51 | }else{ 52 | //读4字节控制域 53 | dis.readFully(controlFields); 54 | if((controlFields[0] & 0x01)==0){ 55 | //I帧 56 | this.apciType = ApciType.I_FORMAT; 57 | //发送序列号 58 | sendSeqNum = ((controlFields[0] & 0xfe) >> 1) + ((controlFields[1] & 0xff) << 7); 59 | //接收序列号 60 | receiveSeqNum = ((controlFields[2] & 0xfe) >> 1) + ((controlFields[3] & 0xff) << 7); 61 | log.debug("I帧,发送序列号:"+sendSeqNum+",接收序列号:"+receiveSeqNum); 62 | }else if ((controlFields[0] & 0x03)==1){ 63 | //S帧 64 | this.apciType = ApciType.S_FORMAT; 65 | receiveSeqNum = ((controlFields[2] & 0xfe) >> 1) + ((controlFields[3] & 0xff) << 7); 66 | log.debug("S帧,接收序列号:"+receiveSeqNum); 67 | }else if ((controlFields[0] & 0x03) == 3){ 68 | //U帧 69 | if (controlFields[0] == 0x07){ 70 | this.apciType = ApciType.STARTDT_ACT; 71 | log.debug("U帧,启动命令"); 72 | }else if (controlFields[0] == 0x0B){ 73 | this.apciType = ApciType.STARTDT_CON; 74 | log.debug("U帧启动确认"); 75 | }else if (controlFields[0] == 0x13){ 76 | this.apciType = ApciType.STOPDT_ACT; 77 | log.debug("U帧停止命令"); 78 | }else if (controlFields[0] == 0x23){ 79 | this.apciType = ApciType.STOPDT_CON; 80 | log.debug("U帧停止确认"); 81 | }else if (controlFields[0] == 0x43){ 82 | this.apciType = ApciType.TESTFR_ACT; 83 | log.debug("U帧测试命令"); 84 | }else if (controlFields[0] == (byte) 0x83){ 85 | this.apciType = ApciType.TESTFR_CON; 86 | log.debug("U帧测试确认"); 87 | } 88 | } 89 | } 90 | //构建信息体 91 | if (len > 6) { 92 | this.asdu = new Asdu(dis); 93 | } 94 | } 95 | 96 | public int encode(byte[] buffer) throws IOException { 97 | 98 | buffer[0] = 0x68; 99 | 100 | int length = 4; 101 | 102 | if (apciType == ApciType.I_FORMAT) { 103 | buffer[2] = (byte) (sendSeqNum << 1); 104 | buffer[3] = (byte) (sendSeqNum >> 7); 105 | buffer[4] = (byte) (receiveSeqNum << 1); 106 | buffer[5] = (byte) (receiveSeqNum >> 7); 107 | length += asdu.encode(buffer, 6); 108 | } 109 | else if (apciType == ApciType.STARTDT_ACT) { 110 | buffer[2] = 0x07; 111 | buffer[3] = 0x00; 112 | buffer[4] = 0x00; 113 | buffer[5] = 0x00; 114 | } 115 | else if (apciType == ApciType.STARTDT_CON) { 116 | buffer[2] = 0x0b; 117 | buffer[3] = 0x00; 118 | buffer[4] = 0x00; 119 | buffer[5] = 0x00; 120 | } 121 | else if (apciType == ApciType.S_FORMAT) { 122 | buffer[2] = 0x01; 123 | buffer[3] = 0x00; 124 | buffer[4] = (byte) (receiveSeqNum << 1); 125 | buffer[5] = (byte) (receiveSeqNum >> 7); 126 | } 127 | 128 | buffer[1] = (byte) length; 129 | 130 | return length + 2; 131 | } 132 | 133 | public ApciType getApciType(){ 134 | return apciType; 135 | } 136 | 137 | public int getSendSeqNumber() { 138 | return sendSeqNum; 139 | } 140 | 141 | public int getReceiveSeqNumber() { 142 | return receiveSeqNum; 143 | } 144 | 145 | public Asdu getAsdu() { 146 | return asdu; 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /src/main/java/com/visenergy/iec104/util/ChangeUtils.java: -------------------------------------------------------------------------------- 1 | package com.visenergy.iec104.util; 2 | 3 | import com.visenergy.iec104.IeShortFloat; 4 | 5 | import java.util.Calendar; 6 | import java.util.GregorianCalendar; 7 | 8 | /** 9 | * Created by Administrator on 2017/5/8 0008. 10 | */ 11 | public class ChangeUtils { 12 | private static final char[] HEX_CHAR_TABLE = { 13 | '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' 14 | }; 15 | 16 | public static String toHexString(Byte[] data){ 17 | byte[] resultBytes = new byte[data.length]; 18 | for(int i =0 ;i>> 4]; 32 | hex[index++] = (byte) HEX_CHAR_TABLE[v & 0xF]; 33 | } 34 | return new String(hex); 35 | } 36 | 37 | public static byte[] hexStringToBytes(String data){ 38 | if(data == null || "".equals(data)) 39 | return null; 40 | data = data.toUpperCase(); 41 | int length = data.length()/2; 42 | char[] dataChars = data.toCharArray(); 43 | byte[] byteData = new byte[length]; 44 | for (int i = 0;i=0;i--){ 58 | stringBuffer.append(String.format("%02d",bytes[i])); 59 | } 60 | return stringBuffer.toString(); 61 | } 62 | 63 | public static String floatToHexstr(float value){ 64 | byte[] buffer = new byte[4]; 65 | new IeShortFloat(value).encode(buffer,0); 66 | return toHexString(buffer); 67 | } 68 | 69 | public static String encode(float value){ 70 | int tempVal = Float.floatToIntBits(value); 71 | byte[] buffer = new byte[4]; 72 | buffer[0] = (byte) tempVal; 73 | buffer[1] = (byte) (tempVal >> 8); 74 | buffer[2] = (byte) (tempVal >> 16); 75 | buffer[3] = (byte) (tempVal >> 24); 76 | int[] s = new int[4]; 77 | StringBuffer sb = new StringBuffer(); 78 | for (int i = 0; i < buffer.length; i++){ 79 | s[i] = (buffer[i] & 0xff); 80 | if (Integer.toHexString(s[i]).length() == 1){ 81 | sb.append("0" + Integer.toHexString(s[i]) + " "); 82 | }else { 83 | sb.append(Integer.toHexString(s[i]) + " "); 84 | } 85 | } 86 | return sb.toString().toUpperCase(); 87 | } 88 | 89 | public static String encodeInfomationAddress(int address) { 90 | byte[] buffer = new byte[3]; 91 | buffer[0] = (byte) address; 92 | buffer[1] = (byte) (address >> 8); 93 | buffer[2] = (byte) (address >> 16); 94 | 95 | int[] s = new int[4]; 96 | StringBuffer sb = new StringBuffer(); 97 | for (int i = 0; i < buffer.length; i++){ 98 | s[i] = (buffer[i] & 0xff); 99 | if (Integer.toHexString(s[i]).length() == 1){ 100 | sb.append("0" + Integer.toHexString(s[i]) + " "); 101 | }else { 102 | sb.append(Integer.toHexString(s[i]) + " "); 103 | } 104 | } 105 | return sb.toString().toUpperCase(); 106 | } 107 | 108 | private static int startSendNum = 1; 109 | 110 | public static void main(String[] args) { 111 | /* Runnable runnable = new Runnable() { 112 | public void run() { 113 | try { 114 | byte[] recNum = new byte[2]; 115 | recNum[0] = (byte) (startSendNum << 1); 116 | recNum[1] = (byte) (startSendNum >> 7); 117 | String recStr = Utils.toHexString(recNum); 118 | System.out.println("******************"+ recStr); 119 | startSendNum++; 120 | System.out.println("******************"+ startSendNum); 121 | } catch (Exception e) { 122 | e.printStackTrace(); 123 | } 124 | } 125 | }; 126 | ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor(); 127 | // 第二个参数为首次执行的延时时间,第三个参数为定时执行的间隔时间 128 | service.scheduleAtFixedRate(runnable, 0, 10, TimeUnit.SECONDS);*/ 129 | 130 | Calendar calendar=new GregorianCalendar(); 131 | int year = Integer.parseInt(String.valueOf(calendar.get(Calendar.YEAR)).substring(2)); 132 | int month = calendar.get(Calendar.MONTH); 133 | int day = calendar.get(Calendar.DATE); 134 | int hour = calendar.get(Calendar.HOUR_OF_DAY); 135 | int minute = calendar.get(Calendar.MINUTE); 136 | int second = calendar.get(Calendar.SECOND); 137 | int milliSecond = calendar.get(Calendar.MILLISECOND); 138 | int handleS = second * 1000 + milliSecond; 139 | 140 | String yearStr = Integer.toHexString(year); 141 | yearStr = yearStr.length() > 1?yearStr:"0".concat(yearStr); 142 | String monthStr = Integer.toHexString(month); 143 | monthStr = monthStr.length() > 1?monthStr:"0".concat(monthStr); 144 | String dayStr = Integer.toHexString(day); 145 | dayStr = dayStr.length() > 1?dayStr:"0".concat(dayStr); 146 | String hourStr = Integer.toHexString(hour); 147 | hourStr = hourStr.length() > 1?hourStr:"0".concat(hourStr); 148 | String minuteStr = Integer.toHexString(minute); 149 | minuteStr = minuteStr.length() > 1?minuteStr:"0".concat(minuteStr); 150 | String handleSStr = Integer.toHexString(handleS); 151 | if(handleSStr.length() == 1){ 152 | handleSStr = "000" + handleSStr; 153 | }else if(handleSStr.length() == 2){ 154 | handleSStr = "00" + handleSStr; 155 | }else if(handleSStr.length() == 3){ 156 | handleSStr = "0" + handleSStr; 157 | } 158 | handleSStr = handleSStr.substring(2) + handleSStr.substring(0,2); 159 | System.out.println(yearStr); 160 | System.out.println(monthStr); 161 | System.out.println(dayStr); 162 | System.out.println(hourStr); 163 | System.out.println(minuteStr); 164 | System.out.println(handleSStr); 165 | } 166 | } 167 | -------------------------------------------------------------------------------- /src/main/java/com/visenergy/iec104/YxStatusObject.java: -------------------------------------------------------------------------------- 1 | package com.visenergy.iec104; 2 | 3 | import com.flying.jdbc.SqlHelper; 4 | import com.flying.jdbc.data.CommandType; 5 | import com.flying.jdbc.data.Parameter; 6 | import com.flying.jdbc.db.type.BaseTypes; 7 | import com.flying.jdbc.util.DBConnection; 8 | import com.rabbitmq.client.Channel; 9 | import com.rabbitmq.client.Connection; 10 | import com.visenergy.iec104.util.RabbitMqUtils; 11 | import net.sf.json.JSONObject; 12 | import org.apache.commons.collections.map.HashedMap; 13 | import org.apache.commons.logging.Log; 14 | import org.apache.commons.logging.LogFactory; 15 | 16 | import java.io.IOException; 17 | import java.math.BigDecimal; 18 | import java.sql.Timestamp; 19 | import java.util.Map; 20 | import java.util.concurrent.Executors; 21 | import java.util.concurrent.ScheduledExecutorService; 22 | import java.util.concurrent.TimeUnit; 23 | import java.util.concurrent.TimeoutException; 24 | 25 | /** 26 | * Created by Fuxdong on 2017/7/26 0026. 27 | */ 28 | public class YxStatusObject { 29 | private Log log = LogFactory.getLog(YxStatusObject.class); 30 | private static String RABBITMQ_QUEUE = "PV_YXSTATUS"; 31 | 32 | private String INVERTER_ID = ""; 33 | private String SERIAL = ""; 34 | private int COMMUNICATE_STATUS = -1; 35 | private int CONNECT_STATUS = -1; 36 | private int PV_CONNECT_STATUS = -1; 37 | private int WARNING_STATUS = -1; 38 | private boolean flag=false; 39 | 40 | private Connection conn = null; 41 | private Channel channel = null; 42 | 43 | public YxStatusObject(String inverterId, String serial){ 44 | this.INVERTER_ID = inverterId; 45 | this.SERIAL = serial; 46 | 47 | //初始化rabbitmq 48 | try { 49 | this.getChannel(); 50 | } catch (IOException e) { 51 | log.error("初始化rabbitMq失败",e); 52 | } catch (TimeoutException e) { 53 | log.error("初始化rabbitMq失败",e); 54 | } 55 | Runnable runnable = new Runnable() { 56 | 57 | public void run() { 58 | if(flag==true){ 59 | String sql = "UPDATE T_PVMANAGE_INVERTER A SET A.COMMUNICATE_STATUS = ?,A.CONNECT_STATUS = ?," + 60 | "A.PV_CONNECT_STATUS = ?,A.WARNING_STATUS = ?,A.TIME=? WHERE A.INVERTER_ID = ?"; 61 | 62 | DBConnection conn = SqlHelper.connPool.getConnection(); 63 | Parameter[] params = new Parameter[6]; 64 | 65 | params[0] = new Parameter("COMMUNICATE_STATUS", BaseTypes.INTEGER,COMMUNICATE_STATUS); 66 | params[1] = new Parameter("CONNECT_STATUS", BaseTypes.INTEGER,CONNECT_STATUS); 67 | params[2] = new Parameter("PV_CONNECT_STATUS", BaseTypes.INTEGER,PV_CONNECT_STATUS); 68 | params[3] = new Parameter("WARNING_STATUS", BaseTypes.INTEGER,WARNING_STATUS); 69 | params[4] = new Parameter("TIME", BaseTypes.TIMESTAMP,new Timestamp(System.currentTimeMillis())); 70 | params[5] = new Parameter("INVERTER_ID", BaseTypes.VARCHAR,INVERTER_ID); 71 | 72 | try { 73 | //将最新数据更新到逆变器实时数据表 74 | SqlHelper.executeNonQuery(conn, CommandType.Text, sql, params); 75 | clear(); 76 | } catch (Exception e) { 77 | e.printStackTrace(); 78 | } 79 | SqlHelper.connPool.releaseConnection(conn); 80 | }else{ 81 | log.debug("未接收到数据"); 82 | } 83 | } 84 | }; 85 | ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor(); 86 | // 第二个参数为首次执行的延时时间,第三个参数为定时执行的间隔时间 87 | service.scheduleAtFixedRate(runnable, 360, 360, TimeUnit.SECONDS); 88 | } 89 | 90 | public String getSERIAL() { 91 | return SERIAL; 92 | } 93 | 94 | public void setSERIAL(String SERIAL) { 95 | this.SERIAL = SERIAL; 96 | } 97 | 98 | public int getCOMMUNICATE_STATUS() { 99 | return COMMUNICATE_STATUS; 100 | } 101 | 102 | public void setCOMMUNICATE_STATUS(int COMMUNICATE_STATUS) { 103 | this.COMMUNICATE_STATUS = COMMUNICATE_STATUS; 104 | this.flag = true; 105 | this.sendRabbitMq("SERIAL","COMMUNICATE_STATUS",COMMUNICATE_STATUS); 106 | } 107 | 108 | public int getCONNECT_STATUS() { 109 | return CONNECT_STATUS; 110 | } 111 | 112 | public void setCONNECT_STATUS(int CONNECT_STATUS) { 113 | this.CONNECT_STATUS = CONNECT_STATUS; 114 | this.flag = true; 115 | this.sendRabbitMq("SERIAL","CONNECT_STATUS",CONNECT_STATUS); 116 | } 117 | 118 | public int getPV_CONNECT_STATUS() { 119 | return PV_CONNECT_STATUS; 120 | } 121 | 122 | public void setPV_CONNECT_STATUS(int PV_CONNECT_STATUS) { 123 | this.PV_CONNECT_STATUS = PV_CONNECT_STATUS; 124 | this.flag = true; 125 | this.sendRabbitMq("SERIAL","PV_CONNECT_STATUS",PV_CONNECT_STATUS); 126 | } 127 | 128 | public int getWARNING_STATUS() { 129 | return WARNING_STATUS; 130 | } 131 | 132 | public void setWARNING_STATUS(int WARNING_STATUS) { 133 | this.WARNING_STATUS = WARNING_STATUS; 134 | this.flag = true; 135 | this.sendRabbitMq("SERIAL","WARNING_STATUS",WARNING_STATUS); 136 | } 137 | 138 | public void clear(){ 139 | // COMMUNICATE_STATUS = -1; 140 | // CONNECT_STATUS = -1; 141 | // PV_CONNECT_STATUS = -1; 142 | // WARNING_STATUS = -1; 143 | this.flag=false; 144 | } 145 | 146 | public Connection getConn() throws IOException, TimeoutException { 147 | if(conn == null){ 148 | conn = RabbitMqUtils.newConnection(); 149 | } 150 | return conn; 151 | } 152 | 153 | public Channel getChannel() throws IOException, TimeoutException { 154 | if(channel == null){ 155 | channel = getConn().createChannel(); 156 | } 157 | return channel; 158 | } 159 | 160 | public void sendRabbitMq(String ID,String name,Object value){ 161 | Map map = new HashedMap(); 162 | map.put("name",ID); 163 | map.put("SERIAL",getSERIAL()); 164 | map.put(name,value); 165 | sendRabbitMq("lightTopology","inverterData",map); 166 | } 167 | 168 | 169 | public void sendRabbitMq(String module,String subModule,Map dataMap){ 170 | Map resultMap = new HashedMap(); 171 | resultMap.put("module",module); 172 | resultMap.put("subModule",subModule); 173 | resultMap.put("data",dataMap); 174 | 175 | try { 176 | RabbitMqUtils.sendMq(channel,RABBITMQ_QUEUE, JSONObject.fromObject(resultMap).toString()); 177 | } catch (IOException e) { 178 | log.error("RabbitMq传输消息失败",e); 179 | } catch (TimeoutException e) { 180 | log.error("RabbitMq传输消息失败",e); 181 | } 182 | } 183 | } 184 | -------------------------------------------------------------------------------- /src/main/java/com/visenergy/iec104/Asdu.java: -------------------------------------------------------------------------------- 1 | package com.visenergy.iec104; 2 | 3 | 4 | import com.visenergy.iec104.util.ChangeUtils; 5 | import org.apache.commons.logging.Log; 6 | import org.apache.commons.logging.LogFactory; 7 | 8 | import java.io.DataInputStream; 9 | import java.io.IOException; 10 | 11 | /** 12 | * Created by Fuxdong on 2017-5-10. 13 | * 14 | */ 15 | public class Asdu { 16 | private Log log = LogFactory.getLog(Apdu.class); 17 | 18 | private final int typeId; 19 | private final boolean isSequenceOfElements; 20 | private int vsq; 21 | private final int addressNum; 22 | private final int causeOfTransmission; 23 | private boolean test; 24 | private boolean negativeConfirm; 25 | private int originatorAddress; 26 | private final int commonAddress; 27 | private InformationObject[] informationObjects; 28 | private byte[] privateInformation; 29 | 30 | public Asdu(int typeId, boolean isSequenceOfElements, int causeOfTransmission, boolean test, 31 | boolean negativeConfirm, int originatorAddress, int commonAddress, InformationObject[] informationObjects) { 32 | 33 | this.typeId = typeId; 34 | this.isSequenceOfElements = isSequenceOfElements; 35 | this.causeOfTransmission = causeOfTransmission; 36 | this.test = test; 37 | this.negativeConfirm = negativeConfirm; 38 | 39 | this.commonAddress = commonAddress; 40 | this.originatorAddress = originatorAddress; 41 | this.informationObjects = informationObjects; 42 | this.privateInformation = null; 43 | 44 | if (isSequenceOfElements) { 45 | this.addressNum = informationObjects[0].getInformationElements().length; 46 | } else { 47 | this.addressNum = informationObjects.length; 48 | } 49 | } 50 | 51 | public Asdu(DataInputStream dataInputStream) throws Exception{ 52 | //获取类型表示配置文件 53 | this.typeId = dataInputStream.readByte() & 0xff; 54 | if (Init.typeIdProp.getProperty(String.valueOf(typeId))== null || "".equals(Init.typeIdProp.getProperty(String.valueOf(typeId)))){ 55 | log.error(new IOException("无效的类型标识:"+typeId)); 56 | }else{ 57 | log.debug("类型标识:" + Init.typeIdProp.getProperty(String.valueOf(typeId))); 58 | } 59 | 60 | int vsqNum = dataInputStream.readByte() & 0xff; 61 | String vsqFormat = String.format("%08d",Integer.parseInt(Integer.toBinaryString(vsqNum))); 62 | //可变结构限定词,转为二进制后获取第8位 63 | vsq = Integer.parseInt(vsqFormat.substring(0,1)); 64 | //可变结构限定词,获取第1-7位,代表信息数据数目 65 | addressNum = Integer.parseInt(vsqFormat.substring(1,8),2); 66 | if (vsq == 1) { 67 | isSequenceOfElements = true; 68 | log.debug("信息体地址连续:" +isSequenceOfElements+",信息数据条数:" + addressNum); 69 | } else { 70 | isSequenceOfElements = false; 71 | log.debug("信息体地址连续:" +isSequenceOfElements+",信息数据条数:" + addressNum); 72 | } 73 | int numberOfSequenceElements; 74 | int numberOfInformationObjects; 75 | //根据是否连续来确定信息对象数目、信息元素数目 76 | if (isSequenceOfElements) { 77 | numberOfSequenceElements = addressNum; 78 | numberOfInformationObjects = 1; 79 | }else { 80 | numberOfInformationObjects = addressNum; 81 | numberOfSequenceElements = 1; 82 | } 83 | byte[] cot = new byte[2]; 84 | dataInputStream.readFully(cot); 85 | //传送原因 86 | causeOfTransmission = Integer.parseInt(ChangeUtils.byteAppend(cot),10); 87 | log.debug("传送原因:" + Init.causeProp.getProperty(String.valueOf(causeOfTransmission))); 88 | //公共地址 89 | byte[] commAddress = new byte[2]; 90 | dataInputStream.readFully(commAddress); 91 | commonAddress = Integer.parseInt(ChangeUtils.byteAppend(commAddress)); 92 | log.debug("公共地址:" + commonAddress); 93 | 94 | //信息体 95 | if (typeId < 128) { 96 | 97 | informationObjects = new InformationObject[numberOfInformationObjects]; 98 | 99 | for (int i = 0; i < numberOfInformationObjects; i++) { 100 | informationObjects[i] = new InformationObject(dataInputStream, typeId, numberOfSequenceElements); 101 | } 102 | 103 | privateInformation = null; 104 | }else{ 105 | log.debug(""); 106 | } 107 | 108 | } 109 | 110 | public int getTypeId() { 111 | return typeId; 112 | } 113 | 114 | public boolean isSequenceOfElements() { 115 | return isSequenceOfElements; 116 | } 117 | 118 | public int getSequenceLength() { 119 | return addressNum; 120 | } 121 | 122 | public int getCauseOfTransmission() { 123 | return causeOfTransmission; 124 | } 125 | 126 | public boolean isTestFrame() { 127 | return test; 128 | } 129 | 130 | public boolean isNegativeConfirm() { 131 | return negativeConfirm; 132 | } 133 | 134 | public Integer getOriginatorAddress() { 135 | return originatorAddress; 136 | } 137 | 138 | public int getCommonAddress() { 139 | return commonAddress; 140 | } 141 | 142 | public InformationObject[] getInformationObjects() { 143 | return informationObjects; 144 | } 145 | 146 | public byte[] getPrivateInformation() { 147 | return privateInformation; 148 | } 149 | 150 | int encode(byte[] buffer, int i) { 151 | 152 | int origi = i; 153 | 154 | buffer[i++] = (byte) typeId; 155 | if (isSequenceOfElements) { 156 | buffer[i++] = (byte) (addressNum | 0x80); 157 | }else { 158 | buffer[i++] = (byte) addressNum; 159 | } 160 | 161 | if (test) { 162 | if (negativeConfirm) { 163 | buffer[i++] = (byte) (causeOfTransmission | 0xC0); 164 | }else { 165 | buffer[i++] = (byte) (causeOfTransmission | 0x80); 166 | } 167 | }else { 168 | if (negativeConfirm) { 169 | buffer[i++] = (byte) (causeOfTransmission | 0x40); 170 | }else { 171 | buffer[i++] = (byte) causeOfTransmission; 172 | } 173 | } 174 | 175 | buffer[i++] = (byte) originatorAddress; 176 | 177 | buffer[i++] = (byte) commonAddress; 178 | 179 | buffer[i++] = (byte) (commonAddress >> 8); 180 | 181 | if (informationObjects != null) { 182 | for (InformationObject informationObject : informationObjects) { 183 | i += informationObject.encode(buffer, i); 184 | } 185 | }else { 186 | System.arraycopy(privateInformation, 0, buffer, i, privateInformation.length); 187 | i += privateInformation.length; 188 | } 189 | return i - origi; 190 | } 191 | 192 | @Override 193 | public String toString() { 194 | 195 | StringBuilder builder = new StringBuilder(); 196 | if (informationObjects != null) { 197 | for (InformationObject informationObject : informationObjects) { 198 | builder.append(informationObject.toString()); 199 | builder.append("\n"); 200 | } 201 | }else { 202 | builder.append("\nPrivate Information:\n"); 203 | int l = 1; 204 | for (byte b : privateInformation) { 205 | if ((l != 1) && ((l - 1) % 8 == 0)) { 206 | builder.append(' '); 207 | } 208 | if ((l != 1) && ((l - 1) % 16 == 0)) { 209 | builder.append('\n'); 210 | } 211 | l++; 212 | builder.append("0x"); 213 | String hexString = Integer.toHexString(b & 0xff); 214 | if (hexString.length() == 1) { 215 | builder.append(0); 216 | } 217 | builder.append(hexString + " "); 218 | } 219 | } 220 | 221 | return builder.toString(); 222 | 223 | } 224 | } 225 | -------------------------------------------------------------------------------- /src/main/java/com/visenergy/iec104/ServerTest.java: -------------------------------------------------------------------------------- 1 | package com.visenergy.iec104; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.InputStreamReader; 5 | import java.io.OutputStream; 6 | import java.net.ServerSocket; 7 | import java.net.Socket; 8 | import java.util.concurrent.Executors; 9 | import java.util.concurrent.ScheduledExecutorService; 10 | import java.util.concurrent.TimeUnit; 11 | 12 | /** 13 | * Created by Administrator on 2017/8/23 0023. 14 | */ 15 | public class ServerTest { 16 | public static void main(String[] args) { 17 | try { 18 | 19 | ServerSocket server = null; 20 | 21 | try { 22 | // 创建一个ServerSocket在端口2405监听客户请求 23 | server = new ServerSocket(2405); 24 | } catch (Exception e) { 25 | // 出错,打印出错信息 26 | System.out.println("can not listen to:" + e); 27 | } 28 | 29 | Socket socket = null; 30 | 31 | try { 32 | // 使用accept()阻塞等待客户请求,有客户 33 | // 请求到来则产生一个Socket对象,并继续执行 34 | socket = server.accept(); 35 | System.out.println("接受"+ socket.getInetAddress() +"连接"); 36 | } catch (Exception e) { 37 | // 出错,打印出错信息 38 | System.out.println("Error." + e); 39 | } 40 | 41 | 42 | // 由Socket对象得到输入流,并构造相应的BufferedReader对象 43 | BufferedReader is = new BufferedReader(new InputStreamReader( 44 | System.in)); 45 | 46 | // 在标准输出上打印从客户端读入的字符串 47 | OutputStream os = socket.getOutputStream(); 48 | 49 | Runnable runnable = new Runnable() { 50 | public void run() { 51 | try { 52 | //生成一组 53 | String pstr1 = GenerateDate.getMinuatesData1().trim(); 54 | 55 | String[] ls1 = pstr1.split(" "); 56 | 57 | System.out.println(pstr1); 58 | for (int i = 0; i < ls1.length; i++) { 59 | os.write((byte)Integer.parseInt(ls1[i],16)); 60 | } 61 | //生成二组 62 | String pstr2 = GenerateDate.getMinuatesData2().trim(); 63 | 64 | String[] ls2 = pstr2.split(" "); 65 | 66 | System.out.println(pstr2); 67 | for (int i = 0; i < ls2.length; i++) { 68 | os.write((byte)Integer.parseInt(ls2[i],16)); 69 | } 70 | //生成3组 71 | String pstr3 = GenerateDate.getMinuatesData3().trim(); 72 | 73 | String[] ls3 = pstr3.split(" "); 74 | 75 | System.out.println(pstr3); 76 | for (int i = 0; i < ls3.length; i++) { 77 | os.write((byte)Integer.parseInt(ls3[i],16)); 78 | } 79 | //生成4组 80 | String pstr4 = GenerateDate.getMinuatesData4(); 81 | 82 | String[] ls4 = pstr4.split(" "); 83 | 84 | System.out.println(pstr4); 85 | for (int i = 0; i < ls4.length; i++) { 86 | os.write((byte)Integer.parseInt(ls4[i],16)); 87 | } 88 | //生成5组 89 | String pstr5 = GenerateDate.getMinuatesData5(); 90 | 91 | String[] ls5 = pstr5.split(" "); 92 | 93 | System.out.println(pstr5); 94 | for (int i = 0; i < ls5.length; i++) { 95 | os.write((byte)Integer.parseInt(ls5[i],16)); 96 | } 97 | //生成6组 98 | String pstr6 = GenerateDate.getMinuatesData6(); 99 | 100 | String[] ls6 = pstr6.split(" "); 101 | 102 | System.out.println(pstr6); 103 | for (int i = 0; i < ls6.length; i++) { 104 | os.write((byte)Integer.parseInt(ls6[i],16)); 105 | } 106 | //生成7组 107 | String pstr7 = GenerateDate.getMinuatesData7(); 108 | 109 | String[] ls7 = pstr7.split(" "); 110 | 111 | System.out.println(pstr7); 112 | for (int i = 0; i < ls7.length; i++) { 113 | os.write((byte)Integer.parseInt(ls7[i],16)); 114 | } 115 | //生成8组 116 | String pstr8 = GenerateDate.getMinuatesData8(); 117 | 118 | String[] ls8 = pstr8.split(" "); 119 | 120 | System.out.println(pstr8); 121 | for (int i = 0; i < ls8.length; i++) { 122 | os.write((byte)Integer.parseInt(ls8[i],16)); 123 | } 124 | //生成9组 125 | String pstr9 = GenerateDate.getMinuatesData9(); 126 | 127 | String[] ls9 = pstr9.split(" "); 128 | 129 | System.out.println(pstr9); 130 | for (int i = 0; i < ls9.length; i++) { 131 | os.write((byte)Integer.parseInt(ls9[i],16)); 132 | } 133 | //生成10组 134 | String pstr10 = GenerateDate.getMinuatesData10(); 135 | 136 | String[] ls10 = pstr10.split(" "); 137 | 138 | System.out.println(pstr10); 139 | for (int i = 0; i < ls10.length; i++) { 140 | os.write((byte)Integer.parseInt(ls10[i],16)); 141 | } 142 | //生成11组 143 | String pstr11 = GenerateDate.getMinuatesData11(); 144 | 145 | String[] ls11 = pstr11.split(" "); 146 | 147 | System.out.println(pstr11); 148 | for (int i = 0; i < ls11.length; i++) { 149 | os.write((byte)Integer.parseInt(ls11[i],16)); 150 | } 151 | //生成1组 152 | String ys1 = GenerateYxStatus.getMinuatesData(); 153 | 154 | String[] lis1 = ys1.split(" "); 155 | 156 | System.out.println(ys1); 157 | for (int i = 0; i < lis1.length; i++) { 158 | os.write((byte)Integer.parseInt(lis1[i],16)); 159 | } 160 | 161 | //生成2组 162 | String ys2 = GenerateYxStatus.getMinuatesData2(); 163 | 164 | String[] lis2 = ys2.split(" "); 165 | 166 | System.out.println(ys2); 167 | for (int i = 0; i < lis2.length; i++) { 168 | os.write((byte)Integer.parseInt(lis2[i],16)); 169 | } 170 | 171 | } catch (Exception e) { 172 | e.printStackTrace(); 173 | } 174 | } 175 | }; 176 | ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor(); 177 | // 第二个参数为首次执行的延时时间,第三个参数为定时执行的间隔时间 178 | service.scheduleAtFixedRate(runnable, 0, 20, TimeUnit.SECONDS); 179 | 180 | /*// 如果该字符串为 "bye",则停止循环 181 | String line = is.readLine(); 182 | 183 | while (!line.equals("bye")) { 184 | String[] ls = line.split(" "); 185 | for (int i = 0; i < ls.length; i++) { 186 | os.write((byte)Integer.parseInt(ls[i],16)); 187 | } 188 | 189 | // 从Client读入一字符串,并打印到标准输出上 190 | line = is.readLine(); 191 | 192 | } // 继续循环 193 | os.close(); // 关闭Socket输出流 194 | 195 | is.close(); // 关闭Socket输入流 196 | 197 | socket.close(); // 关闭Socket 198 | 199 | server.close(); // 关闭ServerSocket*/ 200 | 201 | } catch (Exception e) { 202 | 203 | System.out.println("Error:" + e); 204 | 205 | // 出错,打印出错信息 206 | 207 | } 208 | } 209 | } 210 | -------------------------------------------------------------------------------- /src/main/java/com/visenergy/iec104/YxObject.java: -------------------------------------------------------------------------------- 1 | package com.visenergy.iec104; 2 | 3 | import com.flying.jdbc.SqlHelper; 4 | import com.flying.jdbc.data.CommandType; 5 | import com.flying.jdbc.data.Parameter; 6 | import com.flying.jdbc.db.type.BaseTypes; 7 | import com.flying.jdbc.util.DBConnection; 8 | import org.apache.commons.logging.Log; 9 | import org.apache.commons.logging.LogFactory; 10 | 11 | import java.lang.reflect.Field; 12 | import java.util.UUID; 13 | import java.util.concurrent.Executors; 14 | import java.util.concurrent.ScheduledExecutorService; 15 | import java.util.concurrent.TimeUnit; 16 | 17 | /** 18 | * Created by zhonghuan on 2017/7/25. 19 | */ 20 | public class YxObject { 21 | private Log log = LogFactory.getLog(YxObject.class); 22 | 23 | private String BUILDING_ID; 24 | private String INVERTER_ID; 25 | private int VERSION_FAIL=-1; //软件版本不匹配 26 | private int SYSTEM_FAIL=-1; //系统故障 27 | private int NBI_EXP_FAIL=-1; //逆变电流异常 28 | private int CYI_FAIL=-1; //残余电流异常 29 | private int WDGG_FAIL=-1; //温度过高 30 | private int FS_FAIL=-1; //风扇故障 31 | private int SPI_FAIL=-1; //SPI通讯异常 32 | private int JYZKD_FAIL=-1; //绝缘阻抗低 33 | private int AFCI_FAIL=-1; //AFCI自检失败 34 | private int ZLDH_FAIL=-1; //直流电弧故障 35 | private int ZC3_FAIL=-1; //组串3反向 36 | private int LYBHQ_FAIL=-1; //浪涌保护器故障 37 | private boolean flag=false; 38 | 39 | public YxObject(){ 40 | } 41 | public YxObject(String inverterId, String buildingId){ 42 | this.INVERTER_ID = inverterId; 43 | this.BUILDING_ID = buildingId; 44 | 45 | Runnable runnable = new Runnable() { 46 | 47 | public void run() { 48 | if(flag==true){ 49 | String sql = "INSERT INTO T_PVMANAGE_INVERTER_FAILURE(FA_ID,FA_NAME,BUILDING_ID,INVERTER_ID) " + 50 | "VALUES(?,?,?,?)"; 51 | 52 | DBConnection conn = SqlHelper.connPool.getConnection(); 53 | 54 | YxObject yxTable=new YxObject(); 55 | Class yx=(Class) yxTable.getClass(); 56 | Field[] fields=yx.getDeclaredFields(); 57 | String failureDescription = null; 58 | 59 | for (int i = 0; i > 7); 74 | String recStr = ChangeUtils.toHexString(recNum); 75 | os.write(ChangeUtils.hexStringToBytes("68040100" + recStr)); 76 | log.debug("确认消息,S类型,下一条的接受序号:" + recStr); 77 | }else if (apdu.getApciType() == Apdu.ApciType.STARTDT_ACT) { 78 | os.write(ChangeUtils.hexStringToBytes("68040B000000")); 79 | log.debug("确认启动消息,U类型"); 80 | }else if (apdu.getApciType() == Apdu.ApciType.STOPDT_ACT) { 81 | os.write(ChangeUtils.hexStringToBytes("680423000000")); 82 | log.debug("确认停止消息,U类型"); 83 | }else if (apdu.getApciType() == Apdu.ApciType.TESTFR_ACT) { 84 | os.write(ChangeUtils.hexStringToBytes("680483000000")); 85 | log.debug("确认测试消息,U类型"); 86 | }else{ 87 | log.warn("未知的报文:" + apdu.getApciType()); 88 | } 89 | }catch (Exception e){ 90 | log.error("异常错误",e); 91 | break; 92 | } 93 | } 94 | os.close(); // 关闭Socket输出流 95 | 96 | is.close(); // 关闭Socket输入流 97 | 98 | socket.close(); // 关闭Socket 99 | 100 | } catch (Exception e) { 101 | log.error("Error",e); // 出错,则打印出错信息 102 | } 103 | } 104 | 105 | 106 | public static void handleData(int typeId,InformationObject[] infoObjs) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { 107 | Runnable runnable = new Runnable() { 108 | @Override 109 | public void run() { 110 | try{ 111 | for (int i = 0; i < infoObjs.length; i++) { 112 | if(typeId == 1){//单点遥信处理 113 | int firstAddress = infoObjs[i].getInformationObjectAddress(); 114 | int len = infoObjs[i].getInformationElements().length; 115 | for (int j = 0; j < len; j++) { 116 | int address = firstAddress + j; 117 | if(address >356 || address < 0){ 118 | log.warn("遥信信息超出定义范围:" + address); 119 | } 120 | JSONObject yxObjJson = Init.yxJsonObj.getJSONObject(address+""); 121 | if(yxObjJson != null){ 122 | String yxObjName = null; 123 | if(address>= 0 && address < 32){ 124 | yxObjName = "NO101"; 125 | }else if(address>= 32 && address < 64 ){ 126 | yxObjName = "NO102"; 127 | }else if(address>= 64 && address < 96){ 128 | yxObjName = "NO204"; 129 | }else if(address>= 96 && address < 128){ 130 | yxObjName = "NO205"; 131 | }else if(address>= 128 && address < 160){ 132 | yxObjName = "NO201"; 133 | }else if(address>= 160 && address < 192){ 134 | yxObjName = "NO202"; 135 | }else if(address>= 192 && address < 224){ 136 | yxObjName = "NO203"; 137 | }else if(address>= 224 && address < 256){ 138 | yxObjName = "NO302"; 139 | }else if(address>= 256 && address < 288){ 140 | yxObjName = "NO401"; 141 | }else if(address>= 288 && address < 320){ 142 | yxObjName = "NO402"; 143 | }else if(address>= 320 && address < 352){ 144 | yxObjName = "NO501"; 145 | }else { 146 | //通讯状态 147 | String yxsObjName = null; 148 | //通讯状态值 149 | int flagInt = ((IeSinglePointWithQuality) infoObjs[i].getInformationElements()[j][0]).isOn() ? 1 : 0; 150 | //遍历数据池中所有遥信状态对象 151 | for (Map.Entry entry : DataProcessPool.yxsPool.entrySet()) { 152 | 153 | yxsObjName = null; 154 | //判断地址,确认通讯状态属于哪些逆变器 155 | if (address == 352){ 156 | if ("NO101".equals(entry.getKey()) || "NO102".equals(entry.getKey())){//101栋 157 | yxsObjName = entry.getKey(); 158 | }else { 159 | log.debug("通讯状态与逆变器" + entry.getKey() + "不匹配"); 160 | } 161 | }else if (address == 353){//301栋 162 | if ("NO201".equals(entry.getKey()) || "NO202".equals(entry.getKey()) || "NO203".equals(entry.getKey()) || "NO204".equals(entry.getKey()) || "NO205".equals(entry.getKey())){ 163 | yxsObjName = entry.getKey(); 164 | }else { 165 | log.debug("通讯状态与逆变器" + entry.getKey() + "不匹配"); 166 | } 167 | }else if (address == 354){//302栋 168 | if ("NO302".equals(entry.getKey())){ 169 | yxsObjName = entry.getKey(); 170 | }else { 171 | log.debug("通讯状态与逆变器" + entry.getKey() + "不匹配"); 172 | } 173 | }else if (address == 355){//306栋 174 | if ("NO401".equals(entry.getKey()) || "NO402".equals(entry.getKey())){ 175 | yxsObjName = entry.getKey(); 176 | }else { 177 | log.debug("通讯状态与逆变器" + entry.getKey() + "不匹配"); 178 | } 179 | }else if (address == 356){//401栋 180 | if ("NO501".equals(entry.getKey())){ 181 | yxsObjName = entry.getKey(); 182 | }else { 183 | log.debug("通讯状态与逆变器" + entry.getKey() + "不匹配"); 184 | } 185 | }else { 186 | log.debug("无效的通讯状态地址"); 187 | } 188 | 189 | //遥信状态对象 190 | if (yxsObjName != null){ 191 | log.debug("遥信状态对象 :" + yxsObjName + " ,信息体地址:" + address + ",执行方法:set" + yxObjJson.getString("name") + ",值:" + ((IeSinglePointWithQuality) infoObjs[i].getInformationElements()[j][0]).isOn()); 192 | setValue(3, yxsObjName, "set" + yxObjJson.getString("name"), flagInt, yxObjJson.getString("type")); 193 | }else { 194 | log.warn("遥信状态对象无名称! "); 195 | } 196 | } 197 | } 198 | 199 | //遥信对象 200 | if (yxObjName != null) { 201 | log.debug("遥信对象 :" + yxObjName + " ,信息体地址:" + address + ",执行方法:set" + yxObjJson.getString("name") + ",值:" + ((IeSinglePointWithQuality) infoObjs[i].getInformationElements()[j][0]).isOn()); 202 | int flagInt = ((IeSinglePointWithQuality) infoObjs[i].getInformationElements()[j][0]).isOn() ? 1 : 0; 203 | setValue(1, yxObjName, "set" + yxObjJson.getString("name"), flagInt, yxObjJson.getString("type")); 204 | } else { 205 | log.warn("遥信对象无名称!"); 206 | } 207 | 208 | }else{ 209 | log.warn("找不到的遥信编号: " + address); 210 | } 211 | } 212 | }else if(typeId == 13){//浮点型遥测处理 213 | int firstAddress = infoObjs[i].getInformationObjectAddress(); 214 | int len = infoObjs[i].getInformationElements().length; 215 | for (int j = 0; j < len; j++) { 216 | int address = firstAddress + j; 217 | if (address < 16385 || address > 16909){ 218 | log.warn("遥测信息超出定义范围:" + address); 219 | } 220 | 221 | JSONObject ycObjJson = Init.ycJsonObj.getJSONObject(address+""); 222 | if(ycObjJson != null){ 223 | String ycObjName = null; 224 | if(address>= 16385 && address < 16437){ 225 | ycObjName = "NO101"; 226 | }else if(address>= 16437 && address < 16489 ){ 227 | ycObjName = "NO102"; 228 | }else if(address>= 16498 && address < 16546){ 229 | ycObjName = "NO204"; 230 | }else if(address>= 16546 && address < 16594){ 231 | ycObjName = "NO205"; 232 | }else if(address>= 16594 && address < 16636){ 233 | ycObjName = "NO201"; 234 | }else if(address>= 16636 && address < 16678){ 235 | ycObjName = "NO202"; 236 | }else if(address>= 16678 && address < 16720){ 237 | ycObjName = "NO203"; 238 | }else if(address>= 16720 && address < 16762){ 239 | ycObjName = "NO302"; 240 | }else if(address>= 16762 && address < 16810){ 241 | ycObjName = "NO401"; 242 | }else if(address>= 16810 && address < 16858){ 243 | ycObjName = "NO402"; 244 | }else if(address>= 16858 && address < 16910){ 245 | ycObjName = "NO501"; 246 | }else{ 247 | //遥测,气象数据 248 | for(Map.Entry entry : DataProcessPool.ycPool.entrySet()){ 249 | log.debug("遥测对象 :"+ entry.getKey() +" ,信息体地址:"+ address +",执行方法:set" + ycObjJson.getString("name") +",值:" + ((IeShortFloat)infoObjs[i].getInformationElements()[j][0]).getValue()); 250 | setValue(2,entry.getKey(),"set" + ycObjJson.getString("name"),((IeShortFloat)infoObjs[i].getInformationElements()[j][0]).getValue(),ycObjJson.getString("type")); 251 | } 252 | } 253 | if(ycObjName != null){ 254 | log.debug("遥测对象 :"+ ycObjName +" ,信息体地址:"+ address +",执行方法:set" + ycObjJson.getString("name") +",值:" + ((IeShortFloat)infoObjs[i].getInformationElements()[j][0]).getValue()); 255 | //往YcObject对象中的属性set值 256 | 257 | //判断是否是遥信状态数据(并网、PV连接、警告状态),是:将值set进遥信状态对象(YxStatusObject)对应的属性中 258 | if ("CONNECT_STATUS".equals(ycObjJson.getString("name"))){ 259 | setValue(2,ycObjName,"set" + ycObjJson.getString("name"),(int)((IeShortFloat)infoObjs[i].getInformationElements()[j][0]).getValue(),ycObjJson.getString("type")); 260 | setValue(3,ycObjName,"set" + ycObjJson.getString("name"),(int)((IeShortFloat)infoObjs[i].getInformationElements()[j][0]).getValue(),ycObjJson.getString("type")); 261 | }else if("PV_CONNECT_STATUS".equals(ycObjJson.getString("name"))){ 262 | setValue(2,ycObjName,"set" + ycObjJson.getString("name"),(int)((IeShortFloat)infoObjs[i].getInformationElements()[j][0]).getValue(),ycObjJson.getString("type")); 263 | setValue(3,ycObjName,"set" + ycObjJson.getString("name"),(int)((IeShortFloat)infoObjs[i].getInformationElements()[j][0]).getValue(),ycObjJson.getString("type")); 264 | }else if("WARNING_STATUS".equals(ycObjJson.getString("name"))){ 265 | setValue(2,ycObjName,"set" + ycObjJson.getString("name"),(int)((IeShortFloat)infoObjs[i].getInformationElements()[j][0]).getValue(),ycObjJson.getString("type")); 266 | setValue(3,ycObjName,"set" + ycObjJson.getString("name"),(int)((IeShortFloat)infoObjs[i].getInformationElements()[j][0]).getValue(),ycObjJson.getString("type")); 267 | }else { 268 | setValue(2,ycObjName,"set" + ycObjJson.getString("name"),((IeShortFloat)infoObjs[i].getInformationElements()[j][0]).getValue(),ycObjJson.getString("type")); 269 | } 270 | }else{ 271 | log.warn("遥测对象无名称!"); 272 | } 273 | }else{ 274 | log.warn("找不到的遥测编号: " + address); 275 | } 276 | } 277 | }else { 278 | log.debug("类型标识:" + typeId + "未处理"); 279 | } 280 | } 281 | }catch (Exception e){ 282 | e.printStackTrace(); 283 | } 284 | } 285 | }; 286 | 287 | new Thread(runnable).start(); 288 | } 289 | 290 | /** 291 | * 292 | * @param typeObj 293 | * @param ycSerial 294 | * @param methodName 295 | * @param methodValue 296 | * @throws NoSuchMethodException 297 | * @throws InvocationTargetException 298 | * @throws IllegalAccessException 299 | */ 300 | public static void setValue(int typeObj,String ycSerial,String methodName,Object methodValue,String mt) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { 301 | Object obj = null; 302 | if (typeObj == 1){ 303 | obj = DataProcessPool.yxPool.get(ycSerial); 304 | }else if(typeObj == 2){ 305 | obj = DataProcessPool.ycPool.get(ycSerial); 306 | }else{ 307 | obj = DataProcessPool.yxsPool.get(ycSerial); 308 | } 309 | //执行反射方法 310 | setByReflect(obj,methodName,methodValue,mt); 311 | } 312 | 313 | /** 314 | * 315 | * @param obj 316 | * @param methodName 317 | * @param methodValue 318 | * @throws NoSuchMethodException 319 | * @throws InvocationTargetException 320 | * @throws IllegalAccessException 321 | */ 322 | public static void setByReflect(Object obj,String methodName,Object methodValue,String mt) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { 323 | Method objMethod = null; 324 | if (!"set".equals(methodName)){ 325 | if("DECIMAL".equals(mt)){ 326 | objMethod = obj.getClass().getMethod(methodName,double.class); 327 | }else if("int".equals(mt)){ 328 | objMethod = obj.getClass().getMethod(methodName,int.class); 329 | }else if("String".equals(mt)){ 330 | objMethod = obj.getClass().getMethod(methodName,String.class); 331 | }else{ 332 | log.warn("不存在的方法类型,无法生成反射方法。"); 333 | } 334 | }else { 335 | log.warn("YcObject对象中不存在该set方法"); 336 | } 337 | 338 | if(objMethod != null){ 339 | objMethod.invoke(obj,methodValue); 340 | }else{ 341 | log.warn("反射方法不存在"); 342 | } 343 | } 344 | } 345 | -------------------------------------------------------------------------------- /src/main/resources/yx.json: -------------------------------------------------------------------------------- 1 | { 2 | "0":{"name":"","type":"int","description":"备用"}, 3 | "1":{"name":"VERSION_FAIL","type":"int","description":"101-1N 软件版本不匹配"}, 4 | "2":{"name":"VERSION_FAIL","type":"int","description":"101-1N 软件版本不匹配"}, 5 | "3":{"name":"SYSTEM_FAIL","type":"int","description":"101-1N 系统故障"}, 6 | "4":{"name":"SYSTEM_FAIL","type":"int","description":"101-1N 系统故障"}, 7 | "5":{"name":"","type":"int","description":"101-1N 备用"}, 8 | "6":{"name":"NBI_EXP_FAIL","type":"int","description":"101-1N 逆变电流异常"}, 9 | "7":{"name":"CYI_FAIL","type":"int","description":"101-1N 残余电流异常"}, 10 | "8":{"name":"WDGG_FAIL","type":"int","description":"101-1N 温度过高"}, 11 | "9":{"name":"","type":"int","description":"101-1N 备用"}, 12 | "10":{"name":"SYSTEM_FAIL","type":"int","description":"101-1N 系统故障"}, 13 | "11":{"name":"FS_FAIL","type":"int","description":"101-1N 风扇故障"}, 14 | "12":{"name":"SPI_FAIL","type":"int","description":"101-1N SPI通讯异常"}, 15 | "13":{"name":"","type":"int","description":"101-1N 备用"}, 16 | "14":{"name":"SYSTEM_FAIL","type":"int","description":"101-1N 系统故障"}, 17 | "15":{"name":"","type":"int","description":"101-1N 备用"}, 18 | "16":{"name":"JYZKD_FAIL","type":"int","description":"101-1N 绝缘阻抗低"}, 19 | "17":{"name":"AFCI_FAIL","type":"int","description":"101-1N AFCI自检失败"}, 20 | "18":{"name":"ZLDH_FAIL","type":"int","description":"101-1N 直流电弧故障"}, 21 | "19":{"name":"AFCI_FAIL","type":"int","description":"101-1N AFCI自检失败"}, 22 | "20":{"name":"AFCI_FAIL","type":"int","description":"101-1N AFCI自检失败"}, 23 | "21":{"name":"","type":"int","description":"101-1N 备用"}, 24 | "22":{"name":"","type":"int","description":"101-1N 备用"}, 25 | "23":{"name":"SYSTEM_FAIL","type":"int","description":"101-1N 系统故障"}, 26 | "24":{"name":"SYSTEM_FAIL","type":"int","description":"101-1N 系统故障"}, 27 | "25":{"name":"","type":"int","description":"101-1N 组串3反向"}, 28 | "26":{"name":"","type":"int","description":"101-1N 备用"}, 29 | "27":{"name":"","type":"int","description":"101-1N 备用"}, 30 | "28":{"name":"ZLDH_FAIL","type":"int","description":"101-1N 直流电弧故障"}, 31 | "29":{"name":"ZLDH_FAIL","type":"int","description":"101-1N 直流电弧故障"}, 32 | "30":{"name":"SYSTEM_FAIL","type":"int","description":"101-1N 系统故障"}, 33 | "31":{"name":"","type":"int","description":"101-1N 备用"}, 34 | 35 | "32":{"name":"","type":"int","description":"101-2N 备用"}, 36 | "33":{"name":"VERSION_FAIL","type":"int","description":"101-2N 软件版本不匹配"}, 37 | "34":{"name":"VERSION_FAIL","type":"int","description":"101-2N 软件版本不匹配"}, 38 | "35":{"name":"SYSTEM_FAIL","type":"int","description":"101-2N 系统故障"}, 39 | "36":{"name":"SYSTEM_FAIL","type":"int","description":"101-2N 系统故障"}, 40 | "37":{"name":"","type":"int","description":"101-2N 备用"}, 41 | "38":{"name":"NBI_EXP_FAIL","type":"int","description":"101-2N 逆变电流异常"}, 42 | "39":{"name":"CYI_FAIL","type":"int","description":"101-2N 残余电流异常"}, 43 | "40":{"name":"WDGG_FAIL","type":"int","description":"101-2N 温度过高"}, 44 | "41":{"name":"","type":"int","description":"101-2N 备用"}, 45 | "42":{"name":"SYSTEM_FAIL","type":"int","description":"101-2N 系统故障"}, 46 | "43":{"name":"FS_FAIL","type":"int","description":"101-1N 风扇故障"}, 47 | "44":{"name":"SPI_FAIL","type":"int","description":"101-2N SPI通讯异常"}, 48 | "45":{"name":"","type":"int","description":"101-2N 备用"}, 49 | "46":{"name":"SYSTEM_FAIL","type":"int","description":"101-2N 系统故障"}, 50 | "47":{"name":"","type":"int","description":"101-2N 备用"}, 51 | "48":{"name":"JYZKD_FAIL","type":"int","description":"101-2N 绝缘阻抗低"}, 52 | "49":{"name":"AFCI_FAIL","type":"int","description":"101-2N AFCI自检失败"}, 53 | "50":{"name":"ZLDH_FAIL","type":"int","description":"101-2N 直流电弧故障"}, 54 | "51":{"name":"AFCI_FAIL","type":"int","description":"101-2N AFCI自检失败"}, 55 | "52":{"name":"AFCI_FAIL","type":"int","description":"101-2N AFCI自检失败"}, 56 | "53":{"name":"","type":"int","description":"101-2N 备用"}, 57 | "54":{"name":"","type":"int","description":"101-2N 备用"}, 58 | "55":{"name":"SYSTEM_FAIL","type":"int","description":"101-2N 系统故障"}, 59 | "56":{"name":"SYSTEM_FAIL","type":"int","description":"101-2N 系统故障"}, 60 | "57":{"name":"ZC3_FAIL","type":"int","description":"101-2N 组串3反向"}, 61 | "58":{"name":"","type":"int","description":"101-2N 备用"}, 62 | "59":{"name":"","type":"int","description":"101-2N 备用"}, 63 | "60":{"name":"ZLDH_FAIL","type":"int","description":"101-2N 直流电弧故障"}, 64 | "61":{"name":"ZLDH_FAIL","type":"int","description":"101-2N 直流电弧故障"}, 65 | "62":{"name":"SYSTEM_FAIL","type":"int","description":"101-2N 系统故障"}, 66 | "63":{"name":"","type":"int","description":"101-2N 备用"}, 67 | "64":{"name":"","type":"int","description":"301(33KW)-1N 备用"}, 68 | "65":{"name":"VERSION_FAIL","type":"int","description":"301(33KW)-1N 软件版本不匹配"}, 69 | "66":{"name":"VERSION_FAIL","type":"int","description":"301(33KW)-1N 软件版本不匹配"}, 70 | "67":{"name":"SYSTEM_FAIL","type":"int","description":"301(33KW)-1N 系统故障"}, 71 | "68":{"name":"SYSTEM_FAIL","type":"int","description":"301(33KW)-1N 系统故障"}, 72 | "69":{"name":"","type":"int","description":"301(33KW)-1N 备用"}, 73 | "70":{"name":"NBI_EXP_FAIL","type":"int","description":"301(33KW)-1N 逆变电流异常"}, 74 | "71":{"name":"CYI_FAIL","type":"int","description":"301(33KW)-1N 残余电流异常"}, 75 | "72":{"name":"WDGG_FAIL","type":"int","description":"301(33KW)-1N 温度过高"}, 76 | "73":{"name":"WDGG_FAIL","type":"int","description":"301(33KW)-1N 温度过高"}, 77 | "74":{"name":"","type":"int","description":"301(33KW)-1N 备用"}, 78 | "75":{"name":"FS_FAIL","type":"int","description":"301(33KW)-1N 风扇故障"}, 79 | "76":{"name":"SPI_FAIL","type":"int","description":"301(33KW)-1N SPI通讯异常"}, 80 | "77":{"name":"","type":"int","description":"301(33KW)-1N 备用"}, 81 | "78":{"name":"SYSTEM_FAIL","type":"int","description":"301(33KW)-1N 系统故障"}, 82 | "79":{"name":"SYSTEM_FAIL","type":"int","description":"301(33KW)-1N 系统故障"}, 83 | "80":{"name":"JYZKD_FAIL","type":"int","description":"301(33KW)-1N 绝缘阻抗低"}, 84 | "81":{"name":"","type":"int","description":"301(33KW)-1N 备用"}, 85 | "82":{"name":"","type":"int","description":"301(33KW)-1N 备用"}, 86 | "83":{"name":"SYSTEM_FAIL","type":"int","description":"301(33KW)-1N 系统故障"}, 87 | "84":{"name":"","type":"int","description":"301(33KW)-1N 备用"}, 88 | "85":{"name":"CYI_FAIL","type":"int","description":"301(33KW)-1N 残余电流异常"}, 89 | "86":{"name":"WDGG_FAIL","type":"int","description":"301(33KW)-1N 温度过高"}, 90 | "87":{"name":"LYBHQ_FAIL","type":"int","description":"301(33KW)-1N 浪涌保护器故障"}, 91 | "88":{"name":"LYBHQ_FAIL","type":"int","description":"301(33KW)-1N 浪涌保护器故障"}, 92 | "89":{"name":"ZC3_FAIL","type":"int","description":"301(33KW)-1N 组串3反向"}, 93 | "90":{"name":"","type":"int","description":"301(33KW)-1N 备用"}, 94 | "91":{"name":"","type":"int","description":"301(33KW)-1N 备用"}, 95 | "92":{"name":"","type":"int","description":"301(33KW)-1N 备用"}, 96 | "93":{"name":"","type":"int","description":"301(33KW)-1N 备用"}, 97 | "94":{"name":"","type":"int","description":"301(33KW)-1N 备用"}, 98 | "95":{"name":"SYSTEM_FAIL","type":"int","description":"301(33KW)-1N 系统故障"}, 99 | "96":{"name":"","type":"int","description":"301(33KW)-2N 备用"}, 100 | "97":{"name":"VERSION_FAIL","type":"int","description":"301(33KW)-2N 软件版本不匹配"}, 101 | "98":{"name":"VERSION_FAIL","type":"int","description":"301(33KW)-2N 软件版本不匹配"}, 102 | "99":{"name":"SYSTEM_FAIL","type":"int","description":"301(33KW)-2N 系统故障"}, 103 | "100":{"name":"SYSTEM_FAIL","type":"int","description":"301(33KW)-2N 系统故障"}, 104 | "101":{"name":"","type":"int","description":"301(33KW)-2N 备用"}, 105 | "102":{"name":"NBI_EXP_FAIL","type":"int","description":"301(33KW)-2N 逆变电流异常"}, 106 | "103":{"name":"CYI_FAIL","type":"int","description":"301(33KW)-2N 残余电流异常"}, 107 | "104":{"name":"WDGG_FAIL","type":"int","description":"301(33KW)-2N 温度过高"}, 108 | "105":{"name":"WDGG_FAIL","type":"int","description":"301(33KW)-2N 温度过高"}, 109 | "106":{"name":"","type":"int","description":"301(33KW)-2N 备用"}, 110 | "107":{"name":"FS_FAIL","type":"int","description":"301(33KW)-2N 风扇故障"}, 111 | "108":{"name":"SPI_FAIL","type":"int","description":"301(33KW)-2N SPI通讯异常"}, 112 | "109":{"name":"","type":"int","description":"301(33KW)-2N 备用"}, 113 | "110":{"name":"SYSTEM_FAIL","type":"int","description":"301(33KW)-2N 系统故障"}, 114 | "111":{"name":"SYSTEM_FAIL","type":"int","description":"301(33KW)-2N 系统故障"}, 115 | "112":{"name":"JYZKD_FAIL","type":"int","description":"301(33KW)-2N 绝缘阻抗低"}, 116 | "113":{"name":"","type":"int","description":"301(33KW)-2N 备用"}, 117 | "114":{"name":"","type":"int","description":"301(33KW)-2N 备用"}, 118 | "115":{"name":"SYSTEM_FAIL","type":"int","description":"301(33KW)-2N 系统故障"}, 119 | "116":{"name":"","type":"int","description":"301(33KW)-2N 备用"}, 120 | "117":{"name":"CYI_FAIL","type":"int","description":"301(33KW)-2N 残余电流异常"}, 121 | "118":{"name":"WDGG_FAIL","type":"int","description":"301(33KW)-2N 温度过高"}, 122 | "119":{"name":"LYBHQ_FAIL","type":"int","description":"301(33KW)-2N 浪涌保护器故障"}, 123 | "120":{"name":"LYBHQ_FAIL","type":"int","description":"301(33KW)-2N 浪涌保护器故障"}, 124 | "121":{"name":"ZC3_FAIL","type":"int","description":"301(33KW)-2N 组串3反向"}, 125 | "122":{"name":"","type":"int","description":"301(33KW)-2N 备用"}, 126 | "123":{"name":"","type":"int","description":"301(33KW)-2N 备用"}, 127 | "124":{"name":"","type":"int","description":"301(33KW)-2N 备用"}, 128 | "125":{"name":"","type":"int","description":"301(33KW)-2N 备用"}, 129 | "126":{"name":"","type":"int","description":"301(33KW)-2N 备用"}, 130 | "127":{"name":"SYSTEM_FAIL","type":"int","description":"301(33KW)-2N 系统故障"}, 131 | "128":{"name":"","type":"int","description":"301(17KW)-1N 备用"}, 132 | "129":{"name":"VERSION_FAIL","type":"int","description":"301(17KW)-1N 软件版本不匹配"}, 133 | "130":{"name":"VERSION_FAIL","type":"int","description":"301(17KW)-1N 软件版本不匹配"}, 134 | "131":{"name":"SYSTEM_FAIL","type":"int","description":"301(17KW)-1N 系统故障"}, 135 | "132":{"name":"","type":"int","description":"301(17KW)-1N 备用"}, 136 | "133":{"name":"","type":"int","description":"301(17KW)-1N 备用"}, 137 | "134":{"name":"","type":"int","description":"301(17KW)-1N 逆变电路异常"}, 138 | "135":{"name":"CYI_FAIL","type":"int","description":"301(17KW)-1N 残余电流异常"}, 139 | "136":{"name":"WDGG_FAIL","type":"int","description":"301(17KW)-1N 温度过高"}, 140 | "137":{"name":"WDGG_FAIL","type":"int","description":"301(17KW)-1N 温度过高"}, 141 | "138":{"name":"","type":"int","description":"301(17KW)-1N 备用"}, 142 | "139":{"name":"","type":"int","description":"301(17KW)-1N 备用"}, 143 | "140":{"name":"","type":"int","description":"301(17KW)-1N 备用"}, 144 | "141":{"name":"","type":"int","description":"301(17KW)-1N 备用"}, 145 | "142":{"name":"","type":"int","description":"301(17KW)-1N 备用"}, 146 | "143":{"name":"SYSTEM_FAIL","type":"int","description":"301(17KW)-1N 系统故障"}, 147 | "144":{"name":"JYZKD_FAIL","type":"int","description":"301(17KW)-1N 绝缘阻抗低"}, 148 | "145":{"name":"","type":"int","description":"301(17KW)-1N 备用"}, 149 | "146":{"name":"","type":"int","description":"301(17KW)-1N 备用"}, 150 | "147":{"name":"","type":"int","description":"301(17KW)-1N 备用"}, 151 | "148":{"name":"","type":"int","description":"301(17KW)-1N 备用"}, 152 | "149":{"name":"","type":"int","description":"301(17KW)-1N 备用"}, 153 | "150":{"name":"WDGG_FAIL","type":"int","description":"301(17KW)-1N 温度过高"}, 154 | "151":{"name":"","type":"int","description":"301(17KW)-1N 备用"}, 155 | "152":{"name":"","type":"int","description":"301(17KW)-1N 备用"}, 156 | "153":{"name":"ZC3_FAIL","type":"int","description":"301(17KW)-1N 组串3反向"}, 157 | "154":{"name":"","type":"int","description":"301(17KW)-1N 备用"}, 158 | "155":{"name":"","type":"int","description":"301(17KW)-1N 备用"}, 159 | "156":{"name":"","type":"int","description":"301(17KW)-1N 备用"}, 160 | "157":{"name":"","type":"int","description":"301(17KW)-1N 备用"}, 161 | "158":{"name":"","type":"int","description":"301(17KW)-1N 备用"}, 162 | "159":{"name":"SYSTEM_FAIL","type":"int","description":"301(17KW)-1N 系统故障"}, 163 | "160":{"name":"","type":"int","description":"301(17KW)-2N 备用"}, 164 | "161":{"name":"VERSION_FAIL","type":"int","description":"301(17KW)-2N 软件版本不匹配"}, 165 | "162":{"name":"VERSION_FAIL","type":"int","description":"301(17KW)-2N 软件版本不匹配"}, 166 | "163":{"name":"SYSTEM_FAIL","type":"int","description":"301(17KW)-2N 系统故障"}, 167 | "164":{"name":"","type":"int","description":"301(17KW)-2N 备用"}, 168 | "165":{"name":"","type":"int","description":"301(17KW)-2N 备用"}, 169 | "166":{"name":"","type":"int","description":"301(17KW)-2N 逆变电路异常"}, 170 | "167":{"name":"CYI_FAIL","type":"int","description":"301(17KW)-2N 残余电流异常"}, 171 | "168":{"name":"WDGG_FAIL","type":"int","description":"301(17KW)-2N 温度过高"}, 172 | "169":{"name":"WDGG_FAIL","type":"int","description":"301(17KW)-2N 温度过高"}, 173 | "170":{"name":"","type":"int","description":"301(17KW)-2N 备用"}, 174 | "171":{"name":"","type":"int","description":"301(17KW)-2N 备用"}, 175 | "172":{"name":"","type":"int","description":"301(17KW)-2N 备用"}, 176 | "173":{"name":"","type":"int","description":"301(17KW)-2N 备用"}, 177 | "174":{"name":"","type":"int","description":"301(17KW)-2N 备用"}, 178 | "175":{"name":"SYSTEM_FAIL","type":"int","description":"301(17KW)-2N 系统故障"}, 179 | "176":{"name":"JYZKD_FAIL","type":"int","description":"301(17KW)-2N 绝缘阻抗低"}, 180 | "177":{"name":"","type":"int","description":"301(17KW)-2N 备用"}, 181 | "178":{"name":"","type":"int","description":"301(17KW)-2N 备用"}, 182 | "179":{"name":"","type":"int","description":"301(17KW)-2N 备用"}, 183 | "180":{"name":"","type":"int","description":"301(17KW)-2N 备用"}, 184 | "181":{"name":"","type":"int","description":"301(17KW)-2N 备用"}, 185 | "182":{"name":"WDGG_FAIL","type":"int","description":"301(17KW)-2N 温度过高"}, 186 | "183":{"name":"","type":"int","description":"301(17KW)-2N 备用"}, 187 | "184":{"name":"","type":"int","description":"301(17KW)-2N 备用"}, 188 | "185":{"name":"ZC3_FAIL","type":"int","description":"301(17KW)-2N 组串3反向"}, 189 | "186":{"name":"","type":"int","description":"301(17KW)-2N 备用"}, 190 | "187":{"name":"","type":"int","description":"301(17KW)-2N 备用"}, 191 | "188":{"name":"","type":"int","description":"301(17KW)-2N 备用"}, 192 | "189":{"name":"","type":"int","description":"301(17KW)-2N 备用"}, 193 | "190":{"name":"","type":"int","description":"301(17KW)-2N 备用"}, 194 | "191":{"name":"SYSTEM_FAIL","type":"int","description":"301(17KW)-2N 系统故障"}, 195 | "192":{"name":"","type":"int","description":"301(17KW)-3N 备用"}, 196 | "193":{"name":"VERSION_FAIL","type":"int","description":"301(17KW)-3N 软件版本不匹配"}, 197 | "194":{"name":"VERSION_FAIL","type":"int","description":"301(17KW)-3N 软件版本不匹配"}, 198 | "195":{"name":"SYSTEM_FAIL","type":"int","description":"301(17KW)-3N 系统故障"}, 199 | "196":{"name":"","type":"int","description":"301(17KW)-3N 备用"}, 200 | "197":{"name":"","type":"int","description":"301(17KW)-3N 备用"}, 201 | "198":{"name":"NBI_EXP_FAIL","type":"int","description":"301(17KW)-3N 逆变电路异常"}, 202 | "199":{"name":"CYI_FAIL","type":"int","description":"301(17KW)-3N 残余电流异常"}, 203 | "200":{"name":"WDGG_FAIL","type":"int","description":"301(17KW)-3N 温度过高"}, 204 | "201":{"name":"WDGG_FAIL","type":"int","description":"301(17KW)-3N 温度过高"}, 205 | "202":{"name":"","type":"int","description":"301(17KW)-3N 备用"}, 206 | "203":{"name":"","type":"int","description":"301(17KW)-3N 备用"}, 207 | "204":{"name":"","type":"int","description":"301(17KW)-3N 备用"}, 208 | "205":{"name":"","type":"int","description":"301(17KW)-3N 备用"}, 209 | "206":{"name":"","type":"int","description":"301(17KW)-3N 备用"}, 210 | "207":{"name":"SYSTEM_FAIL","type":"int","description":"301(17KW)-3N 系统故障"}, 211 | "208":{"name":"JYZKD_FAIL","type":"int","description":"301(17KW)-3N 绝缘阻抗低"}, 212 | "209":{"name":"","type":"int","description":"301(17KW)-3N 备用"}, 213 | "210":{"name":"","type":"int","description":"301(17KW)-3N 备用"}, 214 | "211":{"name":"","type":"int","description":"301(17KW)-3N 备用"}, 215 | "212":{"name":"","type":"int","description":"301(17KW)-3N 备用"}, 216 | "213":{"name":"","type":"int","description":"301(17KW)-3N 备用"}, 217 | "214":{"name":"WDGG_FAIL","type":"int","description":"301(17KW)-3N 温度过高"}, 218 | "215":{"name":"","type":"int","description":"301(17KW)-3N 备用"}, 219 | "216":{"name":"","type":"int","description":"301(17KW)-3N 备用"}, 220 | "217":{"name":"ZC3_FAIL","type":"int","description":"301(17KW)-3N 组串3反向"}, 221 | "218":{"name":"","type":"int","description":"301(17KW)-3N 备用"}, 222 | "219":{"name":"","type":"int","description":"301(17KW)-3N 备用"}, 223 | "220":{"name":"","type":"int","description":"301(17KW)-3N 备用"}, 224 | "221":{"name":"","type":"int","description":"301(17KW)-3N 备用"}, 225 | "222":{"name":"","type":"int","description":"301(17KW)-3N 备用"}, 226 | "223":{"name":"SYSTEM_FAIL","type":"int","description":"301(17KW)-3N 系统故障"}, 227 | "224":{"name":"","type":"int","description":"302(17KW)-1N 备用"}, 228 | "225":{"name":"VERSION_FAIL","type":"int","description":"302(17KW)-1N 软件版本不匹配"}, 229 | "226":{"name":"VERSION_FAIL","type":"int","description":"302(17KW)-1N 软件版本不匹配"}, 230 | "227":{"name":"SYSTEM_FAIL","type":"int","description":"302(17KW)-1N 系统故障"}, 231 | "228":{"name":"","type":"int","description":"302(17KW)-1N 备用"}, 232 | "229":{"name":"","type":"int","description":"302(17KW)-1N 备用"}, 233 | "230":{"name":"NBI_EXP_FAIL","type":"int","description":"302(17KW)-1N 逆变电路异常"}, 234 | "231":{"name":"CYI_FAIL","type":"int","description":"302(17KW)-1N 残余电流异常"}, 235 | "232":{"name":"WDGG_FAIL","type":"int","description":"302(17KW)-1N 温度过高"}, 236 | "233":{"name":"WDGG_FAIL","type":"int","description":"302(17KW)-1N 温度过高"}, 237 | "234":{"name":"","type":"int","description":"302(17KW)-1N 备用"}, 238 | "235":{"name":"","type":"int","description":"302(17KW)-1N 备用"}, 239 | "236":{"name":"","type":"int","description":"302(17KW)-1N 备用"}, 240 | "237":{"name":"","type":"int","description":"302(17KW)-1N 备用"}, 241 | "238":{"name":"","type":"int","description":"302(17KW)-1N 备用"}, 242 | "239":{"name":"SYSTEM_FAIL","type":"int","description":"302(17KW)-1N 系统故障"}, 243 | "240":{"name":"JYZKD_FAIL","type":"int","description":"302(17KW)-1N 绝缘阻抗低"}, 244 | "241":{"name":"","type":"int","description":"302(17KW)-1N 备用"}, 245 | "242":{"name":"","type":"int","description":"302(17KW)-1N 备用"}, 246 | "243":{"name":"","type":"int","description":"302(17KW)-1N 备用"}, 247 | "244":{"name":"","type":"int","description":"302(17KW)-1N 备用"}, 248 | "245":{"name":"","type":"int","description":"302(17KW)-1N 备用"}, 249 | "246":{"name":"WDGG_FAIL","type":"int","description":"302(17KW)-1N 温度过高"}, 250 | "247":{"name":"","type":"int","description":"302(17KW)-1N 备用"}, 251 | "248":{"name":"","type":"int","description":"302(17KW)-1N 备用"}, 252 | "249":{"name":"ZC3_FAIL","type":"int","description":"302(17KW)-1N 组串3反向"}, 253 | "250":{"name":"","type":"int","description":"302(17KW)-1N 备用"}, 254 | "251":{"name":"","type":"int","description":"302(17KW)-1N 备用"}, 255 | "252":{"name":"","type":"int","description":"302(17KW)-1N 备用"}, 256 | "253":{"name":"","type":"int","description":"302(17KW)-1N 备用"}, 257 | "254":{"name":"","type":"int","description":"302(17KW)-1N 备用"}, 258 | "255":{"name":"SYSTEM_FAIL","type":"int","description":"302(17KW)-1N 系统故障"}, 259 | "256":{"name":"","type":"int","description":"306-1N 备用"}, 260 | "257":{"name":"VERSION_FAIL","type":"int","description":"306-1N 软件版本不匹配"}, 261 | "258":{"name":"VERSION_FAIL","type":"int","description":"306-1N 软件版本不匹配"}, 262 | "259":{"name":"SYSTEM_FAIL","type":"int","description":"306-1N 系统故障"}, 263 | "260":{"name":"SYSTEM_FAIL","type":"int","description":"306-1N 系统故障"}, 264 | "261":{"name":"","type":"int","description":"306-1N 备用"}, 265 | "262":{"name":"NBI_EXP_FAIL","type":"int","description":"306-1N 逆变电流异常"}, 266 | "263":{"name":"CYI_FAIL","type":"int","description":"306-1N 残余电流异常"}, 267 | "264":{"name":"WDGG_FAIL","type":"int","description":"306-1N 温度过高"}, 268 | "265":{"name":"WDGG_FAIL","type":"int","description":"306-1N 温度过高"}, 269 | "266":{"name":"","type":"int","description":"306-1N 备用"}, 270 | "267":{"name":"FS_FAIL","type":"int","description":"306-1N 风扇故障"}, 271 | "268":{"name":"SPI_FAIL","type":"int","description":"306-1N SPI通讯异常"}, 272 | "269":{"name":"","type":"int","description":"306-1N 备用"}, 273 | "270":{"name":"SYSTEM_FAIL","type":"int","description":"306-1N 系统故障"}, 274 | "271":{"name":"SYSTEM_FAIL","type":"int","description":"306-1N 系统故障"}, 275 | "272":{"name":"JYZKD_FAIL","type":"int","description":"306-1N 绝缘阻抗低"}, 276 | "273":{"name":"","type":"int","description":"306-1N 备用"}, 277 | "274":{"name":"","type":"int","description":"306-1N 备用"}, 278 | "275":{"name":"SYSTEM_FAIL","type":"int","description":"306-1N 系统故障"}, 279 | "276":{"name":"","type":"int","description":"306-1N 备用"}, 280 | "277":{"name":"CYI_FAIL","type":"int","description":"306-1N 残余电流异常"}, 281 | "278":{"name":"WDGG_FAIL","type":"int","description":"306-1N 温度过高"}, 282 | "279":{"name":"LYBHQ_FAIL","type":"int","description":"306-1N 浪涌保护器故障"}, 283 | "280":{"name":"LYBHQ_FAIL","type":"int","description":"306-1N 浪涌保护器故障"}, 284 | "281":{"name":"ZC3_FAIL","type":"int","description":"306-1N 组串3反向"}, 285 | "282":{"name":"","type":"int","description":"306-1N 备用"}, 286 | "283":{"name":"","type":"int","description":"306-1N 备用"}, 287 | "284":{"name":"","type":"int","description":"306-1N 备用"}, 288 | "285":{"name":"","type":"int","description":"306-1N 备用"}, 289 | "286":{"name":"","type":"int","description":"306-1N 备用"}, 290 | "287":{"name":"SYSTEM_FAIL","type":"int","description":"306-1N 系统故障"}, 291 | "288":{"name":"","type":"int","description":"306-2N 备用"}, 292 | "289":{"name":"VERSION_FAIL","type":"int","description":"306-2N 软件版本不匹配"}, 293 | "290":{"name":"VERSION_FAIL","type":"int","description":"306-2N 软件版本不匹配"}, 294 | "291":{"name":"SYSTEM_FAIL","type":"int","description":"306-2N 系统故障"}, 295 | "292":{"name":"SYSTEM_FAIL","type":"int","description":"306-2N 系统故障"}, 296 | "293":{"name":"","type":"int","description":"306-2N 备用"}, 297 | "294":{"name":"NBI_EXP_FAIL","type":"int","description":"306-2N 逆变电流异常"}, 298 | "295":{"name":"CYI_FAIL","type":"int","description":"306-2N 残余电流异常"}, 299 | "296":{"name":"WDGG_FAIL","type":"int","description":"306-2N 温度过高"}, 300 | "297":{"name":"WDGG_FAIL","type":"int","description":"306-2N 温度过高"}, 301 | "298":{"name":"","type":"int","description":"306-2N 备用"}, 302 | "299":{"name":"FS_FAIL","type":"int","description":"306-2N 风扇故障"}, 303 | "300":{"name":"SPI_FAIL","type":"int","description":"306-2N SPI通讯异常"}, 304 | "301":{"name":"","type":"int","description":"306-2N 备用"}, 305 | "302":{"name":"SYSTEM_FAIL","type":"int","description":"306-2N 系统故障"}, 306 | "303":{"name":"SYSTEM_FAIL","type":"int","description":"306-2N 系统故障"}, 307 | "304":{"name":"JYZKD_FAIL","type":"int","description":"306-2N 绝缘阻抗低"}, 308 | "305":{"name":"","type":"int","description":"306-2N 备用"}, 309 | "306":{"name":"","type":"int","description":"306-2N 备用"}, 310 | "307":{"name":"SYSTEM_FAIL","type":"int","description":"306-2N 系统故障"}, 311 | "308":{"name":"","type":"int","description":"306-2N 备用"}, 312 | "309":{"name":"CYI_FAIL","type":"int","description":"306-2N 残余电流异常"}, 313 | "310":{"name":"WDGG_FAIL","type":"int","description":"306-2N 温度过高"}, 314 | "311":{"name":"LYBHQ_FAIL","type":"int","description":"306-2N 浪涌保护器故障"}, 315 | "312":{"name":"LYBHQ_FAIL","type":"int","description":"306-2N 浪涌保护器故障"}, 316 | "313":{"name":"ZC3_FAIL","type":"int","description":"306-2N 组串3反向"}, 317 | "314":{"name":"","type":"int","description":"306-2N 备用"}, 318 | "315":{"name":"","type":"int","description":"306-2N 备用"}, 319 | "316":{"name":"","type":"int","description":"306-2N 备用"}, 320 | "317":{"name":"","type":"int","description":"306-2N 备用"}, 321 | "318":{"name":"","type":"int","description":"306-2N 备用"}, 322 | "319":{"name":"SYSTEM_FAIL","type":"int","description":"306-2N 系统故障"}, 323 | "320":{"name":"","type":"int","description":"401-1N 备用"}, 324 | "321":{"name":"VERSION_FAIL","type":"int","description":"401-1N 软件版本不匹配"}, 325 | "322":{"name":"VERSION_FAIL","type":"int","description":"401-1N 软件版本不匹配"}, 326 | "323":{"name":"SYSTEM_FAIL","type":"int","description":"401-1N 系统故障"}, 327 | "324":{"name":"SYSTEM_FAIL","type":"int","description":"401-1N 系统故障"}, 328 | "325":{"name":"","type":"int","description":"401-1N 备用"}, 329 | "326":{"name":"NBI_EXP_FAIL","type":"int","description":"401-1N 逆变电流异常"}, 330 | "327":{"name":"CYI_FAIL","type":"int","description":"401-1N 残余电流异常"}, 331 | "328":{"name":"WDGG_FAIL","type":"int","description":"401-1N 温度过高"}, 332 | "329":{"name":"","type":"int","description":"401-1N 备用"}, 333 | "330":{"name":"SYSTEM_FAIL","type":"int","description":"401-1N 系统故障"}, 334 | "331":{"name":"FS_FAIL","type":"int","description":"401-1N 风扇故障"}, 335 | "332":{"name":"SPI_FAIL","type":"int","description":"401-1N SPI通讯异常"}, 336 | "333":{"name":"","type":"int","description":"401-1N 备用"}, 337 | "334":{"name":"SYSTEM_FAIL","type":"int","description":"401-1N 系统故障"}, 338 | "335":{"name":"","type":"int","description":"401-1N 备用"}, 339 | "336":{"name":"JYZKD_FAIL","type":"int","description":"401-1N 绝缘阻抗低"}, 340 | "337":{"name":"AFCI_FAIL","type":"int","description":"401-1N AFCI自检失败"}, 341 | "338":{"name":"ZLDH_FAIL","type":"int","description":"401-1N 直流电弧故障"}, 342 | "339":{"name":"AFCI_FAIL","type":"int","description":"401-1N AFCI自检失败"}, 343 | "340":{"name":"AFCI_FAIL","type":"int","description":"401-1N AFCI自检失败"}, 344 | "341":{"name":"","type":"int","description":"401-1N 备用"}, 345 | "342":{"name":"","type":"int","description":"401-1N 备用"}, 346 | "343":{"name":"SYSTEM_FAIL","type":"int","description":"401-1N 系统故障"}, 347 | "344":{"name":"SYSTEM_FAIL","type":"int","description":"401-1N 系统故障"}, 348 | "345":{"name":"ZC3_FAIL","type":"int","description":"401-1N 组串3反向"}, 349 | "346":{"name":"","type":"int","description":"401-1N 备用"}, 350 | "347":{"name":"","type":"int","description":"401-1N 备用"}, 351 | "348":{"name":"ZLDH_FAIL","type":"int","description":"401-1N 直流电弧故障"}, 352 | "349":{"name":"ZLDH_FAIL","type":"int","description":"401-1N 直流电弧故障"}, 353 | "350":{"name":"SYSTEM_FAIL","type":"int","description":"401-1N 系统故障"}, 354 | "351":{"name":"","type":"int","description":"401-1N 备用"}, 355 | "352":{"name":"COMMUNICATE_STATUS","type":"int","description":"节点0_101_通讯状态"}, 356 | "353":{"name":"COMMUNICATE_STATUS","type":"int","description":"节点0_301_通讯状态"}, 357 | "354":{"name":"COMMUNICATE_STATUS","type":"int","description":"节点0_302_通讯状态"}, 358 | "355":{"name":"COMMUNICATE_STATUS","type":"int","description":"节点0_306_通讯状态"}, 359 | "356":{"name":"COMMUNICATE_STATUS","type":"int","description":"节点0_401_通讯状态"} 360 | } 361 | -------------------------------------------------------------------------------- /src/main/resources/yc.json: -------------------------------------------------------------------------------- 1 | { 2 | "16385":{"name":"","type":"DECIMAL","description":"101-1N 额定容量"}, 3 | "16386":{"name":"","type":"DECIMAL","description":"101-1N 输出方式"}, 4 | "16387":{"name":"","type":"DECIMAL","description":"101-1N 系统时间"}, 5 | "16388":{"name":"CO2_CUTS","type":"DECIMAL","description":"101-1N 二氧化碳减排量"}, 6 | "16389":{"name":"PV1_U","type":"DECIMAL","description":"101-1N PV1输入电压"}, 7 | "16390":{"name":"PV1_I","type":"DECIMAL","description":"101-1N PV1输入电流"}, 8 | "16391":{"name":"PV2_U","type":"DECIMAL","description":"101-1N PV2输入电压"}, 9 | "16392":{"name":"PV2_I","type":"DECIMAL","description":"101-1N PV2输入电流"}, 10 | "16393":{"name":"PV3_U","type":"DECIMAL","description":"101-1N PV3输入电压"}, 11 | "16394":{"name":"PV3_I","type":"DECIMAL","description":"101-1N PV3输入电流"}, 12 | "16395":{"name":"PV4_U","type":"DECIMAL","description":"101-1N PV4输入电压"}, 13 | "16396":{"name":"PV4_I","type":"DECIMAL","description":"101-1N PV4输入电流"}, 14 | "16397":{"name":"PV5_U","type":"DECIMAL","description":"101-1N PV5输入电压"}, 15 | "16398":{"name":"PV5_I","type":"DECIMAL","description":"101-1N PV5输入电流"}, 16 | "16399":{"name":"PV6_U","type":"DECIMAL","description":"101-1N PV6输入电压"}, 17 | "16400":{"name":"PV6_I","type":"DECIMAL","description":"101-1N PV6输入电流"}, 18 | "16401":{"name":"","type":"DECIMAL","description":"101-1N 电网AB线电压"}, 19 | "16402":{"name":"","type":"DECIMAL","description":"101-1N 电网BC线电压"}, 20 | "16403":{"name":"","type":"DECIMAL","description":"101-1N 电网CA线电压"}, 21 | "16404":{"name":"AC_UA","type":"DECIMAL","description":"101-1N 电网A相电压"}, 22 | "16405":{"name":"AC_UB","type":"DECIMAL","description":"101-1N 电网B相电压"}, 23 | "16406":{"name":"AC_UC","type":"DECIMAL","description":"101-1N 电网C相电压"}, 24 | "16407":{"name":"AC_IA","type":"DECIMAL","description":"101-1N 电网A相电流"}, 25 | "16408":{"name":"AC_IB","type":"DECIMAL","description":"101-1N 电网B相电流"}, 26 | "16409":{"name":"AC_IC","type":"DECIMAL","description":"101-1N 电网C相电流"}, 27 | "16410":{"name":"GRID_FRQ","type":"DECIMAL","description":"101-1N 电网频率"}, 28 | "16411":{"name":"","type":"DECIMAL","description":"101-1N 功率因数"}, 29 | "16412":{"name":"CONVERT_EFF","type":"DECIMAL","description":"101-1N 效率"}, 30 | "16413":{"name":"MACHINE_TEMP","type":"DECIMAL","description":"101-1N 机内温度"}, 31 | "16414":{"name":"WARNING_STATUS","type":"int","description":"101-1N 逆变器状态"}, 32 | "16415":{"name":"PEAK_POWER","type":"DECIMAL","description":"101-1N 当天峰值有功功率"}, 33 | "16416":{"name":"OUTPUT_P","type":"DECIMAL","description":"101-1N 有功功率"}, 34 | "16417":{"name":"REACTIVE_P","type":"DECIMAL","description":"101-1N 无功功率"}, 35 | "16418":{"name":"CONNECT_P","type":"DECIMAL","description":"101-1N 输入功率"}, 36 | "16419":{"name":"","type":"DECIMAL","description":"101-1N 当前发电量统计时间"}, 37 | "16420":{"name":"ELEC_PROD_HOUR","type":"DECIMAL","description":"101-1N 当前小时发电量"}, 38 | "16421":{"name":"ELEC_PROD_DAILY","type":"DECIMAL","description":"101-1N 当前日发电量"}, 39 | "16422":{"name":"ELEC_PROD_MONTH","type":"DECIMAL","description":"101-1N 当前月发电量"}, 40 | "16423":{"name":"ELEC_PROD_YEAR","type":"DECIMAL","description":"101-1N 当前年发电量"}, 41 | "16424":{"name":"ELEC_PROD_ALL","type":"DECIMAL","description":"101-1N 总发电量"}, 42 | "16425":{"name":"PV7_U","type":"DECIMAL","description":"101-1N PV7输入电压"}, 43 | "16426":{"name":"PV7_I","type":"DECIMAL","description":"101-1N PV7输入电流"}, 44 | "16427":{"name":"PV8_U","type":"DECIMAL","description":"101-1N PV8输入电压"}, 45 | "16428":{"name":"PV8_I","type":"DECIMAL","description":"101-1N PV8输入电流"}, 46 | "16429":{"name":"PV_CONNECT_STATUS","type":"int","description":"101-1N 闭锁状态"}, 47 | "16430":{"name":"","type":"DECIMAL","description":"101-1N 零电压穿越保护状态"}, 48 | "16431":{"name":"","type":"DECIMAL","description":"101-1N 低电压穿越保护状态"}, 49 | "16432":{"name":"","type":"DECIMAL","description":"101-1N 孤岛效应保护状态"}, 50 | "16433":{"name":"CONNECT_STATUS","type":"int","description":"101-1N 并网状态"}, 51 | "16434":{"name":"","type":"DECIMAL","description":"101-1N 绝缘阻抗值"}, 52 | "16435":{"name":"","type":"DECIMAL","description":"101-1N 开机时间"}, 53 | "16436":{"name":"","type":"DECIMAL","description":"101-1N 关机时间"}, 54 | 55 | "16437":{"name":"","type":"DECIMAL","description":"101-2N 额定容量"}, 56 | "16438":{"name":"","type":"DECIMAL","description":"101-2N 输出方式"}, 57 | "16439":{"name":"","type":"DECIMAL","description":"101-2N 系统时间"}, 58 | "16440":{"name":"CO2_CUTS","type":"DECIMAL","description":"101-2N 二氧化碳减排量"}, 59 | "16441":{"name":"PV1_U","type":"DECIMAL","description":"101-2N PV1输入电压"}, 60 | "16442":{"name":"PV1_I","type":"DECIMAL","description":"101-2N PV1输入电流"}, 61 | "16443":{"name":"PV2_U","type":"DECIMAL","description":"101-2N PV2输入电压"}, 62 | "16444":{"name":"PV2_I","type":"DECIMAL","description":"101-2N PV2输入电流"}, 63 | "16445":{"name":"PV3_U","type":"DECIMAL","description":"101-2N PV3输入电压"}, 64 | "16446":{"name":"PV3_I","type":"DECIMAL","description":"101-2N PV3输入电流"}, 65 | "16447":{"name":"PV4_U","type":"DECIMAL","description":"101-2N PV4输入电压"}, 66 | "16448":{"name":"PV4_I","type":"DECIMAL","description":"101-2N PV4输入电流"}, 67 | "16449":{"name":"PV5_U","type":"DECIMAL","description":"101-2N PV5输入电压"}, 68 | "16450":{"name":"PV5_I","type":"DECIMAL","description":"101-2N PV5输入电流"}, 69 | "16451":{"name":"PV6_U","type":"DECIMAL","description":"101-2N PV6输入电压"}, 70 | "16452":{"name":"PV6_I","type":"DECIMAL","description":"101-2N PV6输入电流"}, 71 | "16453":{"name":"","type":"DECIMAL","description":"101-2N 电网AB线电压"}, 72 | "16454":{"name":"","type":"DECIMAL","description":"101-2N 电网BC线电压"}, 73 | "16455":{"name":"","type":"DECIMAL","description":"101-2N 电网CA线电压"}, 74 | "16456":{"name":"AC_UA","type":"DECIMAL","description":"101-2N 电网A相电压"}, 75 | "16457":{"name":"AC_UB","type":"DECIMAL","description":"101-2N 电网B相电压"}, 76 | "16458":{"name":"AC_UC","type":"DECIMAL","description":"101-2N 电网C相电压"}, 77 | "16459":{"name":"AC_IA","type":"DECIMAL","description":"101-2N 电网A相电流"}, 78 | "16460":{"name":"AC_IB","type":"DECIMAL","description":"101-2N 电网B相电流"}, 79 | "16461":{"name":"AC_IC","type":"DECIMAL","description":"101-2N 电网C相电流"}, 80 | "16462":{"name":"GRID_FRQ","type":"DECIMAL","description":"101-2N 电网频率"}, 81 | "16463":{"name":"","type":"DECIMAL","description":"101-2N 功率因数"}, 82 | "16464":{"name":"CONVERT_EFF","type":"DECIMAL","description":"101-2N 效率"}, 83 | "16465":{"name":"MACHINE_TEMP","type":"DECIMAL","description":"101-2N 机内温度"}, 84 | "16466":{"name":"WARNING_STATUS","type":"int","description":"101-2N 逆变器状态"}, 85 | "16467":{"name":"PEAK_POWER","type":"DECIMAL","description":"101-2N 当天峰值有功功率"}, 86 | "16468":{"name":"OUTPUT_P","type":"DECIMAL","description":"101-2N 有功功率"}, 87 | "16469":{"name":"REACTIVE_P","type":"DECIMAL","description":"101-2N 无功功率"}, 88 | "16470":{"name":"CONNECT_P","type":"DECIMAL","description":"101-2N 输入功率"}, 89 | "16471":{"name":"","type":"DECIMAL","description":"101-2N 当前发电量统计时间"}, 90 | "16472":{"name":"ELEC_PROD_HOUR","type":"DECIMAL","description":"101-2N 当前小时发电量"}, 91 | "16473":{"name":"ELEC_PROD_DAILY","type":"DECIMAL","description":"101-2N 当前日发电量"}, 92 | "16474":{"name":"ELEC_PROD_MONTH","type":"DECIMAL","description":"101-2N 当前月发电量"}, 93 | "16475":{"name":"ELEC_PROD_YEAR","type":"DECIMAL","description":"101-2N 当前年发电量"}, 94 | "16476":{"name":"ELEC_PROD_ALL","type":"DECIMAL","description":"101-2N 总发电量"}, 95 | "16477":{"name":"PV7_U","type":"DECIMAL","description":"101-2N PV7输入电压"}, 96 | "16478":{"name":"PV7_I","type":"DECIMAL","description":"101-2N PV7输入电流"}, 97 | "16479":{"name":"PV8_U","type":"DECIMAL","description":"101-2N PV8输入电压"}, 98 | "16480":{"name":"PV8_I","type":"DECIMAL","description":"101-2N PV8输入电流"}, 99 | "16481":{"name":"PV_CONNECT_STATUS","type":"int","description":"101-2N 闭锁状态"}, 100 | "16482":{"name":"","type":"DECIMAL","description":"101-2N 零电压穿越保护状态"}, 101 | "16483":{"name":"","type":"DECIMAL","description":"101-2N 低电压穿越保护状态"}, 102 | "16484":{"name":"","type":"DECIMAL","description":"101-2N 孤岛效应保护状态"}, 103 | "16485":{"name":"CONNECT_STATUS","type":"int","description":"101-2N 并网状态"}, 104 | "16486":{"name":"","type":"DECIMAL","description":"101-2N 绝缘阻抗值"}, 105 | "16487":{"name":"","type":"DECIMAL","description":"101-2N 开机时间"}, 106 | "16488":{"name":"","type":"DECIMAL","description":"101-2N 关机时间"}, 107 | 108 | "16489":{"name":"RADIANT_QUANTITY_1","type":"DECIMAL","description":"辐射量1"}, 109 | "16490":{"name":"IRRADIANCE_1","type":"DECIMAL","description":"辐照度1"}, 110 | "16491":{"name":"RADIANT_QUANTITY_2","type":"DECIMAL","description":"辐射量2"}, 111 | "16492":{"name":"IRRADIANCE_2","type":"DECIMAL","description":"辐照度2"}, 112 | "16493":{"name":"AMBIENT_TEMP","type":"DECIMAL","description":"温度"}, 113 | "16494":{"name":"DAMPNESS","type":"DECIMAL","description":"湿度"}, 114 | "16495":{"name":"PRESSURE","type":"DECIMAL","description":"压力"}, 115 | "16496":{"name":"WIND_SPEED","type":"DECIMAL","description":"风速"}, 116 | "16497":{"name":"WIND_DIR","type":"DECIMAL","description":"风向"}, 117 | 118 | "16498":{"name":"","type":"DECIMAL","description":"301(33KW)-1N 额定容量"}, 119 | "16499":{"name":"","type":"DECIMAL","description":"301(33KW)-1N 输出方式"}, 120 | "16500":{"name":"","type":"DECIMAL","description":"301(33KW)-1N 系统时间"}, 121 | "16501":{"name":"CO2_CUTS","type":"DECIMAL","description":"301(33KW)-1N 二氧化碳减排量"}, 122 | "16502":{"name":"PV1_U","type":"DECIMAL","description":"301(33KW)-1N PV1输入电压"}, 123 | "16503":{"name":"PV1_I","type":"DECIMAL","description":"301(33KW)-1N PV1输入电流"}, 124 | "16504":{"name":"PV2_U","type":"DECIMAL","description":"301(33KW)-1N PV2输入电压"}, 125 | "16505":{"name":"PV2_I","type":"DECIMAL","description":"301(33KW)-1N PV2输入电流"}, 126 | "16506":{"name":"PV3_U","type":"DECIMAL","description":"301(33KW)-1N PV3输入电压"}, 127 | "16507":{"name":"PV3_I","type":"DECIMAL","description":"301(33KW)-1N PV3输入电流"}, 128 | "16508":{"name":"PV4_U","type":"DECIMAL","description":"301(33KW)-1N PV4输入电压"}, 129 | "16509":{"name":"PV4_I","type":"DECIMAL","description":"301(33KW)-1N PV4输入电流"}, 130 | "16510":{"name":"PV5_U","type":"DECIMAL","description":"301(33KW)-1N PV5输入电压"}, 131 | "16511":{"name":"PV5_I","type":"DECIMAL","description":"301(33KW)-1N PV5输入电流"}, 132 | "16512":{"name":"PV6_U","type":"DECIMAL","description":"301(33KW)-1N PV6输入电压"}, 133 | "16513":{"name":"PV6_I","type":"DECIMAL","description":"301(33KW)-1N PV6输入电流"}, 134 | "16514":{"name":"","type":"DECIMAL","description":"301(33KW)-1N 电网AB线电压"}, 135 | "16515":{"name":"","type":"DECIMAL","description":"301(33KW)-1N 电网BC线电压"}, 136 | "16516":{"name":"","type":"DECIMAL","description":"301(33KW)-1N 电网CA线电压"}, 137 | "16517":{"name":"AC_UA","type":"DECIMAL","description":"301(33KW)-1N 电网A相电压"}, 138 | "16518":{"name":"AC_UB","type":"DECIMAL","description":"301(33KW)-1N 电网B相电压"}, 139 | "16519":{"name":"AC_UC","type":"DECIMAL","description":"301(33KW)-1N 电网C相电压"}, 140 | "16520":{"name":"AC_IA","type":"DECIMAL","description":"301(33KW)-1N 电网A相电流"}, 141 | "16521":{"name":"AC_IB","type":"DECIMAL","description":"301(33KW)-1N 电网B相电流"}, 142 | "16522":{"name":"AC_IC","type":"DECIMAL","description":"301(33KW)-1N 电网C相电流"}, 143 | "16523":{"name":"GRID_FRQ","type":"DECIMAL","description":"301(33KW)-1N 电网频率"}, 144 | "16524":{"name":"","type":"DECIMAL","description":"301(33KW)-1N 功率因数"}, 145 | "16525":{"name":"CONVERT_EFF","type":"DECIMAL","description":"301(33KW)-1N 效率"}, 146 | "16526":{"name":"MACHINE_TEMP","type":"DECIMAL","description":"301(33KW)-1N 机内温度"}, 147 | "16527":{"name":"WARNING_STATUS","type":"int","description":"301(33KW)-1N 逆变器状态"}, 148 | "16528":{"name":"PEAK_POWER","type":"DECIMAL","description":"301(33KW)-1N 当天峰值有功功率"}, 149 | "16529":{"name":"OUTPUT_P","type":"DECIMAL","description":"301(33KW)-1N 有功功率"}, 150 | "16530":{"name":"REACTIVE_P","type":"DECIMAL","description":"301(33KW)-1N 无功功率"}, 151 | "16531":{"name":"CONNECT_P","type":"DECIMAL","description":"301(33KW)-1N 输入功率"}, 152 | "16532":{"name":"","type":"DECIMAL","description":"301(33KW)-1N 当前发电量统计时间"}, 153 | "16533":{"name":"ELEC_PROD_HOUR","type":"DECIMAL","description":"301(33KW)-1N 当前小时发电量"}, 154 | "16534":{"name":"ELEC_PROD_DAILY","type":"DECIMAL","description":"301(33KW)-1N 当前日发电量"}, 155 | "16535":{"name":"ELEC_PROD_MONTH","type":"DECIMAL","description":"301(33KW)-1N 当前月发电量"}, 156 | "16536":{"name":"ELEC_PROD_YEAR","type":"DECIMAL","description":"301(33KW)-1N 当前年发电量"}, 157 | "16537":{"name":"ELEC_PROD_ALL","type":"DECIMAL","description":"301(33KW)-1N 总发电量"}, 158 | "16538":{"name":"PV_CONNECT_STATUS","type":"int","description":"301(33KW)-1N 闭锁状态"}, 159 | "16539":{"name":"","type":"DECIMAL","description":"301(33KW)-1N 零电压穿越保护状态"}, 160 | "16540":{"name":"","type":"DECIMAL","description":"301(33KW)-1N 低电压穿越保护状态"}, 161 | "16541":{"name":"","type":"DECIMAL","description":"301(33KW)-1N 孤岛效应保护状态"}, 162 | "16542":{"name":"CONNECT_STATUS","type":"int","description":"301(33KW)-1N 并网状态"}, 163 | "16543":{"name":"","type":"DECIMAL","description":"301(33KW)-1N 绝缘阻抗值"}, 164 | "16544":{"name":"","type":"DECIMAL","description":"301(33KW)-1N 开机时间"}, 165 | "16545":{"name":"","type":"DECIMAL","description":"301(33KW)-1N 关机时间"}, 166 | 167 | "16546":{"name":"","type":"DECIMAL","description":"301(33KW)-2N 额定容量"}, 168 | "16547":{"name":"","type":"DECIMAL","description":"301(33KW)-2N 输出方式"}, 169 | "16548":{"name":"","type":"DECIMAL","description":"301(33KW)-2N 系统时间"}, 170 | "16549":{"name":"CO2_CUTS","type":"DECIMAL","description":"301(33KW)-2N 二氧化碳减排量"}, 171 | "16550":{"name":"PV1_U","type":"DECIMAL","description":"301(33KW)-2N PV1输入电压"}, 172 | "16551":{"name":"PV1_I","type":"DECIMAL","description":"301(33KW)-2N PV1输入电流"}, 173 | "16552":{"name":"PV2_U","type":"DECIMAL","description":"301(33KW)-2N PV2输入电压"}, 174 | "16553":{"name":"PV2_I","type":"DECIMAL","description":"301(33KW)-2N PV2输入电流"}, 175 | "16554":{"name":"PV3_U","type":"DECIMAL","description":"301(33KW)-2N PV3输入电压"}, 176 | "16555":{"name":"PV3_I","type":"DECIMAL","description":"301(33KW)-2N PV3输入电流"}, 177 | "16556":{"name":"PV4_U","type":"DECIMAL","description":"301(33KW)-2N PV4输入电压"}, 178 | "16557":{"name":"PV4_I","type":"DECIMAL","description":"301(33KW)-2N PV4输入电流"}, 179 | "16558":{"name":"PV5_U","type":"DECIMAL","description":"301(33KW)-2N PV5输入电压"}, 180 | "16559":{"name":"PV5_I","type":"DECIMAL","description":"301(33KW)-2N PV5输入电流"}, 181 | "16560":{"name":"PV6_U","type":"DECIMAL","description":"301(33KW)-2N PV6输入电压"}, 182 | "16561":{"name":"PV6_I","type":"DECIMAL","description":"301(33KW)-2N PV6输入电流"}, 183 | "16562":{"name":"","type":"DECIMAL","description":"301(33KW)-2N 电网AB线电压"}, 184 | "16563":{"name":"","type":"DECIMAL","description":"301(33KW)-2N 电网BC线电压"}, 185 | "16564":{"name":"","type":"DECIMAL","description":"301(33KW)-2N 电网CA线电压"}, 186 | "16565":{"name":"AC_UA","type":"DECIMAL","description":"301(33KW)-2N 电网A相电压"}, 187 | "16566":{"name":"AC_UB","type":"DECIMAL","description":"301(33KW)-2N 电网B相电压"}, 188 | "16567":{"name":"AC_UC","type":"DECIMAL","description":"301(33KW)-2N 电网C相电压"}, 189 | "16568":{"name":"AC_IA","type":"DECIMAL","description":"301(33KW)-2N 电网A相电流"}, 190 | "16569":{"name":"AC_IB","type":"DECIMAL","description":"301(33KW)-2N 电网B相电流"}, 191 | "16570":{"name":"AC_IC","type":"DECIMAL","description":"301(33KW)-2N 电网C相电流"}, 192 | "16571":{"name":"GRID_FRQ","type":"DECIMAL","description":"301(33KW)-2N 电网频率"}, 193 | "16572":{"name":"","type":"DECIMAL","description":"301(33KW)-2N 功率因数"}, 194 | "16573":{"name":"CONVERT_EFF","type":"DECIMAL","description":"301(33KW)-2N 效率"}, 195 | "16574":{"name":"MACHINE_TEMP","type":"DECIMAL","description":"301(33KW)-2N 机内温度"}, 196 | "16575":{"name":"WARNING_STATUS","type":"int","description":"301(33KW)-2N 逆变器状态"}, 197 | "16576":{"name":"PEAK_POWER","type":"DECIMAL","description":"301(33KW)-2N 当天峰值有功功率"}, 198 | "16577":{"name":"OUTPUT_P","type":"DECIMAL","description":"301(33KW)-2N 有功功率"}, 199 | "16578":{"name":"REACTIVE_P","type":"DECIMAL","description":"301(33KW)-2N 无功功率"}, 200 | "16579":{"name":"CONNECT_P","type":"DECIMAL","description":"301(33KW)-2N 输入功率"}, 201 | "16580":{"name":"","type":"DECIMAL","description":"301(33KW)-2N 当前发电量统计时间"}, 202 | "16581":{"name":"ELEC_PROD_HOUR","type":"DECIMAL","description":"301(33KW)-2N 当前小时发电量"}, 203 | "16582":{"name":"ELEC_PROD_DAILY","type":"DECIMAL","description":"301(33KW)-2N 当前日发电量"}, 204 | "16583":{"name":"ELEC_PROD_MONTH","type":"DECIMAL","description":"301(33KW)-2N 当前月发电量"}, 205 | "16584":{"name":"ELEC_PROD_YEAR","type":"DECIMAL","description":"301(33KW)-2N 当前年发电量"}, 206 | "16585":{"name":"ELEC_PROD_ALL","type":"DECIMAL","description":"301(33KW)-2N 总发电量"}, 207 | "16586":{"name":"PV_CONNECT_STATUS","type":"int","description":"301(33KW)-2N 闭锁状态"}, 208 | "16587":{"name":"","type":"DECIMAL","description":"301(33KW)-2N 零电压穿越保护状态"}, 209 | "16588":{"name":"","type":"DECIMAL","description":"301(33KW)-2N 低电压穿越保护状态"}, 210 | "16589":{"name":"","type":"DECIMAL","description":"301(33KW)-2N 孤岛效应保护状态"}, 211 | "16590":{"name":"CONNECT_STATUS","type":"int","description":"301(33KW)-2N 并网状态"}, 212 | "16591":{"name":"","type":"DECIMAL","description":"301(33KW)-2N 绝缘阻抗值"}, 213 | "16592":{"name":"","type":"DECIMAL","description":"301(33KW)-2N 开机时间"}, 214 | "16593":{"name":"","type":"DECIMAL","description":"301(33KW)-2N 关机时间"}, 215 | 216 | "16594":{"name":"PV1_U","type":"DECIMAL","description":"301(17KW)-1N PV1输入电压"}, 217 | "16595":{"name":"PV2_U","type":"DECIMAL","description":"301(17KW)-1N PV2输入电压"}, 218 | "16596":{"name":"PV3_U","type":"DECIMAL","description":"301(17KW)-1N PV3输入电压"}, 219 | "16597":{"name":"PV4_U","type":"DECIMAL","description":"301(17KW)-1N PV4输入电压"}, 220 | "16598":{"name":"PV5_U","type":"DECIMAL","description":"301(17KW)-1N PV5输入电压"}, 221 | "16599":{"name":"PV6_U","type":"DECIMAL","description":"301(17KW)-1N PV6输入电压"}, 222 | "16600":{"name":"PV1_I","type":"DECIMAL","description":"301(17KW)-1N PV1输入电流"}, 223 | "16601":{"name":"PV2_I","type":"DECIMAL","description":"301(17KW)-1N PV2输入电流"}, 224 | "16602":{"name":"PV3_I","type":"DECIMAL","description":"301(17KW)-1N PV3输入电流"}, 225 | "16603":{"name":"PV4_I","type":"DECIMAL","description":"301(17KW)-1N PV4输入电流"}, 226 | "16604":{"name":"PV5_I","type":"DECIMAL","description":"301(17KW)-1N PV5输入电流"}, 227 | "16605":{"name":"PV6_I","type":"DECIMAL","description":"301(17KW)-1N PV6输入电流"}, 228 | "16606":{"name":"CO2_CUTS","type":"DECIMAL","description":"301(17KW)-1N 二氧化碳减排量"}, 229 | "16607":{"name":"OUTPUT_P","type":"DECIMAL","description":"301(17KW)-1N 有功功率"}, 230 | "16608":{"name":"","type":"DECIMAL","description":"301(17KW)-1N 电网AB线电压"}, 231 | "16609":{"name":"","type":"DECIMAL","description":"301(17KW)-1N 电网BC线电压"}, 232 | "16610":{"name":"","type":"DECIMAL","description":"301(17KW)-1N 电网CA线电压"}, 233 | "16611":{"name":"","type":"DECIMAL","description":"301(17KW)-1N 功率因数"}, 234 | "16612":{"name":"MACHINE_TEMP","type":"DECIMAL","description":"301(17KW)-1N 机内温度"}, 235 | "16613":{"name":"REACTIVE_P","type":"DECIMAL","description":"301(17KW)-1N 输出无功功率"}, 236 | "16614":{"name":"GRID_FRQ","type":"DECIMAL","description":"301(17KW)-1N 电网频率"}, 237 | "16615":{"name":"ELEC_PROD_ALL","type":"DECIMAL","description":"301(17KW)-1N 总发电量"}, 238 | "16616":{"name":"ELEC_PROD_DAILY","type":"DECIMAL","description":"301(17KW)-1N 当天发电量"}, 239 | "16617":{"name":"AC_IA","type":"DECIMAL","description":"301(17KW)-1N 电网A相电流"}, 240 | "16618":{"name":"AC_IB","type":"DECIMAL","description":"301(17KW)-1N 电网B相电流"}, 241 | "16619":{"name":"AC_IC","type":"DECIMAL","description":"301(17KW)-1N 电网C相电流"}, 242 | "16620":{"name":"AC_UA","type":"DECIMAL","description":"301(17KW)-1N 电网A相电压"}, 243 | "16621":{"name":"AC_UB","type":"DECIMAL","description":"301(17KW)-1N 电网B相电压"}, 244 | "16622":{"name":"AC_UC","type":"DECIMAL","description":"301(17KW)-1N 电网C相电压"}, 245 | "16623":{"name":"","type":"DECIMAL","description":"301(17KW)-1N 开机时间"}, 246 | "16624":{"name":"","type":"DECIMAL","description":"301(17KW)-1N 关机时间"}, 247 | "16625":{"name":"CONVERT_EFF","type":"DECIMAL","description":"301(17KW)-1N 逆变器效率"}, 248 | "16626":{"name":"","type":"DECIMAL","description":"301(17KW)-1N MPPT1输入总功率"}, 249 | "16627":{"name":"","type":"DECIMAL","description":"301(17KW)-1N MPPT2输入总功率"}, 250 | "16628":{"name":"","type":"DECIMAL","description":"301(17KW)-1N MPPT3输入总功率"}, 251 | "16629":{"name":"CONNECT_P","type":"DECIMAL","description":"301(17KW)-1N 输入总功率"}, 252 | "16630":{"name":"","type":"DECIMAL","description":"301(17KW)-1N 零电压穿越保护"}, 253 | "16631":{"name":"","type":"DECIMAL","description":"301(17KW)-1N 低电压穿越保护"}, 254 | "16632":{"name":"","type":"DECIMAL","description":"301(17KW)-1N 孤岛效应保护"}, 255 | "16633":{"name":"PV_CONNECT_STATUS","type":"int","description":"301(17KW)-1N 闭锁状态"}, 256 | "16634":{"name":"","type":"DECIMAL","description":"301(17KW)-1N 开关机状态"}, 257 | "16635":{"name":"WARNING_STATUS","type":"int","description":"301(17KW)-1N 逆变器状态"}, 258 | 259 | "16636":{"name":"PV1_U","type":"DECIMAL","description":"301(17KW)-2N PV1输入电压"}, 260 | "16637":{"name":"PV2_U","type":"DECIMAL","description":"301(17KW)-2N PV2输入电压"}, 261 | "16638":{"name":"PV3_U","type":"DECIMAL","description":"301(17KW)-2N PV3输入电压"}, 262 | "16639":{"name":"PV4_U","type":"DECIMAL","description":"301(17KW)-2N PV4输入电压"}, 263 | "16640":{"name":"PV5_U","type":"DECIMAL","description":"301(17KW)-2N PV5输入电压"}, 264 | "16641":{"name":"PV6_U","type":"DECIMAL","description":"301(17KW)-2N PV6输入电压"}, 265 | "16642":{"name":"PV1_I","type":"DECIMAL","description":"301(17KW)-2N PV1输入电流"}, 266 | "16643":{"name":"PV2_I","type":"DECIMAL","description":"301(17KW)-2N PV2输入电流"}, 267 | "16644":{"name":"PV3_I","type":"DECIMAL","description":"301(17KW)-2N PV3输入电流"}, 268 | "16645":{"name":"PV4_I","type":"DECIMAL","description":"301(17KW)-2N PV4输入电流"}, 269 | "16646":{"name":"PV5_I","type":"DECIMAL","description":"301(17KW)-2N PV5输入电流"}, 270 | "16647":{"name":"PV6_I","type":"DECIMAL","description":"301(17KW)-2N PV6输入电流"}, 271 | "16648":{"name":"CO2_CUTS","type":"DECIMAL","description":"301(17KW)-2N 二氧化碳减排量"}, 272 | "16649":{"name":"OUTPUT_P","type":"DECIMAL","description":"301(17KW)-2N 有功功率"}, 273 | "16650":{"name":"","type":"DECIMAL","description":"301(17KW)-2N 电网AB线电压"}, 274 | "16651":{"name":"","type":"DECIMAL","description":"301(17KW)-2N 电网BC线电压"}, 275 | "16652":{"name":"","type":"DECIMAL","description":"301(17KW)-2N 电网CA线电压"}, 276 | "16653":{"name":"","type":"DECIMAL","description":"301(17KW)-2N 功率因数"}, 277 | "16654":{"name":"MACHINE_TEMP","type":"DECIMAL","description":"301(17KW)-2N 机内温度"}, 278 | "16655":{"name":"REACTIVE_P","type":"DECIMAL","description":"301(17KW)-2N 输出无功功率"}, 279 | "16656":{"name":"GRID_FRQ","type":"DECIMAL","description":"301(17KW)-2N 电网频率"}, 280 | "16657":{"name":"ELEC_PROD_ALL","type":"DECIMAL","description":"301(17KW)-2N 总发电量"}, 281 | "16658":{"name":"ELEC_PROD_DAILY","type":"DECIMAL","description":"301(17KW)-2N 当天发电量"}, 282 | "16659":{"name":"AC_IA","type":"DECIMAL","description":"301(17KW)-2N 电网A相电流"}, 283 | "16660":{"name":"AC_IB","type":"DECIMAL","description":"301(17KW)-2N 电网B相电流"}, 284 | "16661":{"name":"AC_IC","type":"DECIMAL","description":"301(17KW)-2N 电网C相电流"}, 285 | "16662":{"name":"AC_UA","type":"DECIMAL","description":"301(17KW)-2N 电网A相电压"}, 286 | "16663":{"name":"AC_UB","type":"DECIMAL","description":"301(17KW)-2N 电网B相电压"}, 287 | "16664":{"name":"AC_UC","type":"DECIMAL","description":"301(17KW)-2N 电网C相电压"}, 288 | "16665":{"name":"","type":"DECIMAL","description":"301(17KW)-2N 开机时间"}, 289 | "16666":{"name":"","type":"DECIMAL","description":"301(17KW)-2N 关机时间"}, 290 | "16667":{"name":"CONVERT_EFF","type":"DECIMAL","description":"301(17KW)-2N 逆变器效率"}, 291 | "16668":{"name":"","type":"DECIMAL","description":"301(17KW)-2N MPPT1输入总功率"}, 292 | "16669":{"name":"","type":"DECIMAL","description":"301(17KW)-2N MPPT2输入总功率"}, 293 | "16670":{"name":"","type":"DECIMAL","description":"301(17KW)-2N MPPT3输入总功率"}, 294 | "16671":{"name":"CONNECT_P","type":"DECIMAL","description":"301(17KW)-2N 输入总功率"}, 295 | "16672":{"name":"","type":"DECIMAL","description":"301(17KW)-2N 零电压穿越保护"}, 296 | "16673":{"name":"","type":"DECIMAL","description":"301(17KW)-2N 低电压穿越保护"}, 297 | "16674":{"name":"","type":"DECIMAL","description":"301(17KW)-2N 孤岛效应保护"}, 298 | "16675":{"name":"PV_CONNECT_STATUS","type":"int","description":"301(17KW)-2N 闭锁状态"}, 299 | "16676":{"name":"","type":"DECIMAL","description":"301(17KW)-2N 开关机状态"}, 300 | "16677":{"name":"WARNING_STATUS","type":"int","description":"301(17KW)-2N 逆变器状态"}, 301 | 302 | "16678":{"name":"PV1_U","type":"DECIMAL","description":"301(17KW)-3N PV1输入电压"}, 303 | "16679":{"name":"PV2_U","type":"DECIMAL","description":"301(17KW)-3N PV2输入电压"}, 304 | "16680":{"name":"PV3_U","type":"DECIMAL","description":"301(17KW)-3N PV3输入电压"}, 305 | "16681":{"name":"PV4_U","type":"DECIMAL","description":"301(17KW)-3N PV4输入电压"}, 306 | "16682":{"name":"PV5_U","type":"DECIMAL","description":"301(17KW)-3N PV5输入电压"}, 307 | "16683":{"name":"PV6_U","type":"DECIMAL","description":"301(17KW)-3N PV6输入电压"}, 308 | "16684":{"name":"PV1_I","type":"DECIMAL","description":"301(17KW)-3N PV1输入电流"}, 309 | "16685":{"name":"PV2_I","type":"DECIMAL","description":"301(17KW)-3N PV2输入电流"}, 310 | "16686":{"name":"PV3_I","type":"DECIMAL","description":"301(17KW)-3N PV3输入电流"}, 311 | "16687":{"name":"PV4_I","type":"DECIMAL","description":"301(17KW)-3N PV4输入电流"}, 312 | "16688":{"name":"PV5_I","type":"DECIMAL","description":"301(17KW)-3N PV5输入电流"}, 313 | "16689":{"name":"PV6_I","type":"DECIMAL","description":"301(17KW)-3N PV6输入电流"}, 314 | "16690":{"name":"CO2_CUTS","type":"DECIMAL","description":"301(17KW)-3N 二氧化碳减排量"}, 315 | "16691":{"name":"OUTPUT_P","type":"DECIMAL","description":"301(17KW)-3N 有功功率"}, 316 | "16692":{"name":"","type":"DECIMAL","description":"301(17KW)-3N 电网AB线电压"}, 317 | "16693":{"name":"","type":"DECIMAL","description":"301(17KW)-3N 电网BC线电压"}, 318 | "16694":{"name":"","type":"DECIMAL","description":"301(17KW)-3N 电网CA线电压"}, 319 | "16695":{"name":"","type":"DECIMAL","description":"301(17KW)-3N 功率因数"}, 320 | "16696":{"name":"MACHINE_TEMP","type":"DECIMAL","description":"301(17KW)-3N 机内温度"}, 321 | "16697":{"name":"REACTIVE_P","type":"DECIMAL","description":"301(17KW)-3N 输出无功功率"}, 322 | "16698":{"name":"GRID_FRQ","type":"DECIMAL","description":"301(17KW)-3N 电网频率"}, 323 | "16699":{"name":"ELEC_PROD_ALL","type":"DECIMAL","description":"301(17KW)-3N 总发电量"}, 324 | "16700":{"name":"ELEC_PROD_DAILY","type":"DECIMAL","description":"301(17KW)-3N 当天发电量"}, 325 | "16701":{"name":"AC_IA","type":"DECIMAL","description":"301(17KW)-3N 电网A相电流"}, 326 | "16702":{"name":"AC_IB","type":"DECIMAL","description":"301(17KW)-3N 电网B相电流"}, 327 | "16703":{"name":"AC_IC","type":"DECIMAL","description":"301(17KW)-3N 电网C相电流"}, 328 | "16704":{"name":"AC_UA","type":"DECIMAL","description":"301(17KW)-3N 电网A相电压"}, 329 | "16705":{"name":"AC_UB","type":"DECIMAL","description":"301(17KW)-3N 电网B相电压"}, 330 | "16706":{"name":"AC_UC","type":"DECIMAL","description":"301(17KW)-3N 电网C相电压"}, 331 | "16707":{"name":"","type":"DECIMAL","description":"301(17KW)-3N 开机时间"}, 332 | "16708":{"name":"","type":"DECIMAL","description":"301(17KW)-3N 关机时间"}, 333 | "16709":{"name":"CONVERT_EFF","type":"DECIMAL","description":"301(17KW)-3N 逆变器效率"}, 334 | "16710":{"name":"","type":"DECIMAL","description":"301(17KW)-3N MPPT1输入总功率"}, 335 | "16711":{"name":"","type":"DECIMAL","description":"301(17KW)-3N MPPT2输入总功率"}, 336 | "16712":{"name":"","type":"DECIMAL","description":"301(17KW)-3N MPPT3输入总功率"}, 337 | "16713":{"name":"CONNECT_P","type":"DECIMAL","description":"301(17KW)-3N 输入总功率"}, 338 | "16714":{"name":"","type":"DECIMAL","description":"301(17KW)-3N 零电压穿越保护"}, 339 | "16715":{"name":"","type":"DECIMAL","description":"301(17KW)-3N 低电压穿越保护"}, 340 | "16716":{"name":"","type":"DECIMAL","description":"301(17KW)-3N 孤岛效应保护"}, 341 | "16717":{"name":"PV_CONNECT_STATUS","type":"int","description":"301(17KW)-3N 闭锁状态"}, 342 | "16718":{"name":"","type":"DECIMAL","description":"301(17KW)-3N 开关机状态"}, 343 | "16719":{"name":"WARNING_STATUS","type":"int","description":"301(17KW)-3N 逆变器状态"}, 344 | 345 | "16720":{"name":"PV1_U","type":"DECIMAL","description":"302(17KW)-1N PV1输入电压"}, 346 | "16721":{"name":"PV2_U","type":"DECIMAL","description":"302(17KW)-1N PV2输入电压"}, 347 | "16722":{"name":"PV3_U","type":"DECIMAL","description":"302(17KW)-1N PV3输入电压"}, 348 | "16723":{"name":"PV4_U","type":"DECIMAL","description":"302(17KW)-1N PV4输入电压"}, 349 | "16724":{"name":"PV5_U","type":"DECIMAL","description":"302(17KW)-1N PV5输入电压"}, 350 | "16725":{"name":"PV6_U","type":"DECIMAL","description":"302(17KW)-1N PV6输入电压"}, 351 | "16726":{"name":"PV1_I","type":"DECIMAL","description":"302(17KW)-1N PV1输入电流"}, 352 | "16727":{"name":"PV2_I","type":"DECIMAL","description":"302(17KW)-1N PV2输入电流"}, 353 | "16728":{"name":"PV3_I","type":"DECIMAL","description":"302(17KW)-1N PV3输入电流"}, 354 | "16729":{"name":"PV4_I","type":"DECIMAL","description":"302(17KW)-1N PV4输入电流"}, 355 | "16730":{"name":"PV5_I","type":"DECIMAL","description":"302(17KW)-1N PV5输入电流"}, 356 | "16731":{"name":"PV6_I","type":"DECIMAL","description":"302(17KW)-1N PV6输入电流"}, 357 | "16732":{"name":"CO2_CUTS","type":"DECIMAL","description":"302(17KW)-1N 二氧化碳减排量"}, 358 | "16733":{"name":"OUTPUT_P","type":"DECIMAL","description":"302(17KW)-1N 有功功率"}, 359 | "16734":{"name":"","type":"DECIMAL","description":"302(17KW)-1N 电网AB线电压"}, 360 | "16735":{"name":"","type":"DECIMAL","description":"302(17KW)-1N 电网BC线电压"}, 361 | "16736":{"name":"","type":"DECIMAL","description":"302(17KW)-1N 电网CA线电压"}, 362 | "16737":{"name":"","type":"DECIMAL","description":"302(17KW)-1N 功率因数"}, 363 | "16738":{"name":"MACHINE_TEMP","type":"DECIMAL","description":"302(17KW)-1N 机内温度"}, 364 | "16739":{"name":"REACTIVE_P","type":"DECIMAL","description":"302(17KW)-1N 输出无功功率"}, 365 | "16740":{"name":"GRID_FRQ","type":"DECIMAL","description":"302(17KW)-1N 电网频率"}, 366 | "16741":{"name":"ELEC_PROD_ALL","type":"DECIMAL","description":"302(17KW)-1N 总发电量"}, 367 | "16742":{"name":"ELEC_PROD_DAILY","type":"DECIMAL","description":"302(17KW)-1N 当天发电量"}, 368 | "16743":{"name":"AC_IA","type":"DECIMAL","description":"302(17KW)-1N 电网A相电流"}, 369 | "16744":{"name":"AC_IB","type":"DECIMAL","description":"302(17KW)-1N 电网B相电流"}, 370 | "16745":{"name":"AC_IC","type":"DECIMAL","description":"302(17KW)-1N 电网C相电流"}, 371 | "16746":{"name":"AC_UA","type":"DECIMAL","description":"302(17KW)-1N 电网A相电压"}, 372 | "16747":{"name":"AC_UB","type":"DECIMAL","description":"302(17KW)-1N 电网B相电压"}, 373 | "16748":{"name":"AC_UC","type":"DECIMAL","description":"302(17KW)-1N 电网C相电压"}, 374 | "16749":{"name":"","type":"DECIMAL","description":"302(17KW)-1N 开机时间"}, 375 | "16750":{"name":"","type":"DECIMAL","description":"302(17KW)-1N 关机时间"}, 376 | "16751":{"name":"CONVERT_EFF","type":"DECIMAL","description":"302(17KW)-1N 逆变器效率"}, 377 | "16752":{"name":"","type":"DECIMAL","description":"302(17KW)-1N MPPT1输入总功率"}, 378 | "16753":{"name":"","type":"DECIMAL","description":"302(17KW)-1N MPPT2输入总功率"}, 379 | "16754":{"name":"","type":"DECIMAL","description":"302(17KW)-1N MPPT3输入总功率"}, 380 | "16755":{"name":"CONNECT_P","type":"DECIMAL","description":"302(17KW)-1N 输入总功率"}, 381 | "16756":{"name":"","type":"DECIMAL","description":"302(17KW)-1N 零电压穿越保护"}, 382 | "16757":{"name":"","type":"DECIMAL","description":"302(17KW)-1N 低电压穿越保护"}, 383 | "16758":{"name":"","type":"DECIMAL","description":"302(17KW)-1N 孤岛效应保护"}, 384 | "16759":{"name":"PV_CONNECT_STATUS","type":"int","description":"302(17KW)-1N 闭锁状态"}, 385 | "16760":{"name":"","type":"DECIMAL","description":"302(17KW)-1N 开关机状态"}, 386 | "16761":{"name":"WARNING_STATUS","type":"int","description":"302(17KW)-1N 逆变器状态"}, 387 | 388 | "16762":{"name":"","type":"DECIMAL","description":"306-1N 额定容量"}, 389 | "16763":{"name":"","type":"DECIMAL","description":"306-1N 输出方式"}, 390 | "16764":{"name":"","type":"DECIMAL","description":"306-1N 系统时间"}, 391 | "16765":{"name":"CO2_CUTS","type":"DECIMAL","description":"306-1N 二氧化碳减排量"}, 392 | "16766":{"name":"PV1_U","type":"DECIMAL","description":"306-1N PV1输入电压"}, 393 | "16767":{"name":"PV1_I","type":"DECIMAL","description":"306-1N PV1输入电流"}, 394 | "16768":{"name":"PV2_U","type":"DECIMAL","description":"306-1N PV2输入电压"}, 395 | "16769":{"name":"PV2_I","type":"DECIMAL","description":"306-1N PV2输入电流"}, 396 | "16770":{"name":"PV3_U","type":"DECIMAL","description":"306-1N PV3输入电压"}, 397 | "16771":{"name":"PV3_I","type":"DECIMAL","description":"306-1N PV3输入电流"}, 398 | "16772":{"name":"PV4_U","type":"DECIMAL","description":"306-1N PV4输入电压"}, 399 | "16773":{"name":"PV4_I","type":"DECIMAL","description":"306-1N PV4输入电流"}, 400 | "16774":{"name":"PV5_U","type":"DECIMAL","description":"306-1N PV5输入电压"}, 401 | "16775":{"name":"PV5_I","type":"DECIMAL","description":"306-1N PV5输入电流"}, 402 | "16776":{"name":"PV6_U","type":"DECIMAL","description":"306-1N PV6输入电压"}, 403 | "16777":{"name":"PV6_I","type":"DECIMAL","description":"306-1N PV6输入电流"}, 404 | "16778":{"name":"","type":"DECIMAL","description":"306-1N 电网AB线电压"}, 405 | "16779":{"name":"","type":"DECIMAL","description":"306-1N 电网BC线电压"}, 406 | "16780":{"name":"","type":"DECIMAL","description":"306-1N 电网CA线电压"}, 407 | "16781":{"name":"AC_UA","type":"DECIMAL","description":"306-1N 电网A相电压"}, 408 | "16782":{"name":"AC_UB","type":"DECIMAL","description":"306-1N 电网B相电压"}, 409 | "16783":{"name":"AC_UC","type":"DECIMAL","description":"306-1N 电网C相电压"}, 410 | "16784":{"name":"AC_IA","type":"DECIMAL","description":"306-1N 电网A相电流"}, 411 | "16785":{"name":"AC_IB","type":"DECIMAL","description":"306-1N 电网B相电流"}, 412 | "16786":{"name":"AC_IC","type":"DECIMAL","description":"306-1N 电网C相电流"}, 413 | "16787":{"name":"GRID_FRQ","type":"DECIMAL","description":"306-1N 电网频率"}, 414 | "16788":{"name":"","type":"DECIMAL","description":"306-1N 功率因数"}, 415 | "16789":{"name":"CONVERT_EFF","type":"DECIMAL","description":"306-1N 效率"}, 416 | "16790":{"name":"MACHINE_TEMP","type":"DECIMAL","description":"306-1N 机内温度"}, 417 | "16791":{"name":"WARNING_STATUS","type":"int","description":"306-1N 逆变器状态"}, 418 | "16792":{"name":"PEAK_POWER","type":"DECIMAL","description":"306-1N 当天峰值有功功率"}, 419 | "16793":{"name":"OUTPUT_P","type":"DECIMAL","description":"306-1N 有功功率"}, 420 | "16794":{"name":"REACTIVE_P","type":"DECIMAL","description":"306-1N 无功功率"}, 421 | "16795":{"name":"CONNECT_P","type":"DECIMAL","description":"306-1N 输入功率"}, 422 | "16796":{"name":"","type":"DECIMAL","description":"306-1N 当前发电量统计时间"}, 423 | "16797":{"name":"ELEC_PROD_HOUR","type":"DECIMAL","description":"306-1N 当前小时发电量"}, 424 | "16798":{"name":"ELEC_PROD_DAILY","type":"DECIMAL","description":"306-1N 当前日发电量"}, 425 | "16799":{"name":"ELEC_PROD_MONTH","type":"DECIMAL","description":"306-1N 当前月发电量"}, 426 | "16800":{"name":"ELEC_PROD_YEAR","type":"DECIMAL","description":"306-1N 当前年发电量"}, 427 | "16801":{"name":"ELEC_PROD_ALL","type":"DECIMAL","description":"306-1N 总发电量"}, 428 | "16802":{"name":"PV_CONNECT_STATUS","type":"int","description":"306-1N 闭锁状态"}, 429 | "16803":{"name":"","type":"DECIMAL","description":"306-1N 零电压穿越保护状态"}, 430 | "16804":{"name":"","type":"DECIMAL","description":"306-1N 低电压穿越保护状态"}, 431 | "16805":{"name":"","type":"DECIMAL","description":"306-1N 孤岛效应保护状态"}, 432 | "16806":{"name":"CONNECT_STATUS","type":"int","description":"306-1N 并网状态"}, 433 | "16807":{"name":"","type":"DECIMAL","description":"306-1N 绝缘阻抗值"}, 434 | "16808":{"name":"","type":"DECIMAL","description":"306-1N 开机时间"}, 435 | "16809":{"name":"","type":"DECIMAL","description":"306-1N 关机时间"}, 436 | 437 | "16810":{"name":"","type":"DECIMAL","description":"306-2N 额定容量"}, 438 | "16811":{"name":"","type":"DECIMAL","description":"306-2N 输出方式"}, 439 | "16812":{"name":"","type":"DECIMAL","description":"306-2N 系统时间"}, 440 | "16813":{"name":"CO2_CUTS","type":"DECIMAL","description":"306-2N 二氧化碳减排量"}, 441 | "16814":{"name":"PV1_U","type":"DECIMAL","description":"306-2N PV1输入电压"}, 442 | "16815":{"name":"PV1_I","type":"DECIMAL","description":"306-2N PV1输入电流"}, 443 | "16816":{"name":"PV2_U","type":"DECIMAL","description":"306-2N PV2输入电压"}, 444 | "16817":{"name":"PV2_I","type":"DECIMAL","description":"306-2N PV2输入电流"}, 445 | "16818":{"name":"PV3_U","type":"DECIMAL","description":"306-2N PV3输入电压"}, 446 | "16819":{"name":"PV3_I","type":"DECIMAL","description":"306-2N PV3输入电流"}, 447 | "16820":{"name":"PV4_U","type":"DECIMAL","description":"306-2N PV4输入电压"}, 448 | "16821":{"name":"PV4_I","type":"DECIMAL","description":"306-2N PV4输入电流"}, 449 | "16822":{"name":"PV5_U","type":"DECIMAL","description":"306-2N PV5输入电压"}, 450 | "16823":{"name":"PV5_I","type":"DECIMAL","description":"306-2N PV5输入电流"}, 451 | "16824":{"name":"PV6_U","type":"DECIMAL","description":"306-2N PV6输入电压"}, 452 | "16825":{"name":"PV6_I","type":"DECIMAL","description":"306-2N PV6输入电流"}, 453 | "16826":{"name":"","type":"DECIMAL","description":"306-2N 电网AB线电压"}, 454 | "16827":{"name":"","type":"DECIMAL","description":"306-2N 电网BC线电压"}, 455 | "16828":{"name":"","type":"DECIMAL","description":"306-2N 电网CA线电压"}, 456 | "16829":{"name":"AC_UA","type":"DECIMAL","description":"306-2N 电网A相电压"}, 457 | "16830":{"name":"AC_UB","type":"DECIMAL","description":"306-2N 电网B相电压"}, 458 | "16831":{"name":"AC_UC","type":"DECIMAL","description":"306-2N 电网C相电压"}, 459 | "16832":{"name":"AC_IA","type":"DECIMAL","description":"306-2N 电网A相电流"}, 460 | "16833":{"name":"AC_IB","type":"DECIMAL","description":"306-2N 电网B相电流"}, 461 | "16834":{"name":"AC_IC","type":"DECIMAL","description":"306-2N 电网C相电流"}, 462 | "16835":{"name":"GRID_FRQ","type":"DECIMAL","description":"306-2N 电网频率"}, 463 | "16836":{"name":"","type":"DECIMAL","description":"306-2N 功率因数"}, 464 | "16837":{"name":"CONVERT_EFF","type":"DECIMAL","description":"306-2N 效率"}, 465 | "16838":{"name":"MACHINE_TEMP","type":"DECIMAL","description":"306-2N 机内温度"}, 466 | "16839":{"name":"WARNING_STATUS","type":"int","description":"306-2N 逆变器状态"}, 467 | "16840":{"name":"PEAK_POWER","type":"DECIMAL","description":"306-2N 当天峰值有功功率"}, 468 | "16841":{"name":"OUTPUT_P","type":"DECIMAL","description":"306-2N 有功功率"}, 469 | "16842":{"name":"REACTIVE_P","type":"DECIMAL","description":"306-2N 无功功率"}, 470 | "16843":{"name":"CONNECT_P","type":"DECIMAL","description":"306-2N 输入功率"}, 471 | "16844":{"name":"","type":"DECIMAL","description":"306-2N 当前发电量统计时间"}, 472 | "16845":{"name":"ELEC_PROD_HOUR","type":"DECIMAL","description":"306-2N 当前小时发电量"}, 473 | "16846":{"name":"ELEC_PROD_DAILY","type":"DECIMAL","description":"306-2N 当前日发电量"}, 474 | "16847":{"name":"ELEC_PROD_MONTH","type":"DECIMAL","description":"306-2N 当前月发电量"}, 475 | "16848":{"name":"ELEC_PROD_YEAR","type":"DECIMAL","description":"306-2N 当前年发电量"}, 476 | "16849":{"name":"ELEC_PROD_ALL","type":"DECIMAL","description":"306-2N 总发电量"}, 477 | "16850":{"name":"PV_CONNECT_STATUS","type":"int","description":"306-2N 闭锁状态"}, 478 | "16851":{"name":"","type":"DECIMAL","description":"306-2N 零电压穿越保护状态"}, 479 | "16852":{"name":"","type":"DECIMAL","description":"306-2N 低电压穿越保护状态"}, 480 | "16853":{"name":"","type":"DECIMAL","description":"306-2N 孤岛效应保护状态"}, 481 | "16854":{"name":"CONNECT_STATUS","type":"int","description":"306-2N 并网状态"}, 482 | "16855":{"name":"","type":"DECIMAL","description":"306-2N 绝缘阻抗值"}, 483 | "16856":{"name":"","type":"DECIMAL","description":"306-2N 开机时间"}, 484 | "16857":{"name":"","type":"DECIMAL","description":"306-2N 关机时间"}, 485 | 486 | "16858":{"name":"","type":"DECIMAL","description":"401-1N 额定容量"}, 487 | "16859":{"name":"","type":"DECIMAL","description":"401-1N 输出方式"}, 488 | "16860":{"name":"","type":"DECIMAL","description":"401-1N 系统时间"}, 489 | "16861":{"name":"CO2_CUTS","type":"DECIMAL","description":"401-1N 二氧化碳减排量"}, 490 | "16862":{"name":"PV1_U","type":"DECIMAL","description":"401-1N PV1输入电压"}, 491 | "16863":{"name":"PV1_I","type":"DECIMAL","description":"401-1N PV1输入电流"}, 492 | "16864":{"name":"PV2_U","type":"DECIMAL","description":"401-1N PV2输入电压"}, 493 | "16865":{"name":"PV2_I","type":"DECIMAL","description":"401-1N PV2输入电流"}, 494 | "16866":{"name":"PV3_U","type":"DECIMAL","description":"401-1N PV3输入电压"}, 495 | "16867":{"name":"PV3_I","type":"DECIMAL","description":"401-1N PV3输入电流"}, 496 | "16868":{"name":"PV4_U","type":"DECIMAL","description":"401-1N PV4输入电压"}, 497 | "16869":{"name":"PV4_I","type":"DECIMAL","description":"401-1N PV4输入电流"}, 498 | "16870":{"name":"PV5_U","type":"DECIMAL","description":"401-1N PV5输入电压"}, 499 | "16871":{"name":"PV5_I","type":"DECIMAL","description":"401-1N PV5输入电流"}, 500 | "16872":{"name":"PV6_U","type":"DECIMAL","description":"401-1N PV6输入电压"}, 501 | "16873":{"name":"PV6_I","type":"DECIMAL","description":"401-1N PV6输入电流"}, 502 | "16874":{"name":"","type":"DECIMAL","description":"401-1N 电网AB线电压"}, 503 | "16875":{"name":"","type":"DECIMAL","description":"401-1N 电网BC线电压"}, 504 | "16876":{"name":"","type":"DECIMAL","description":"401-1N 电网CA线电压"}, 505 | "16877":{"name":"AC_UA","type":"DECIMAL","description":"401-1N 电网A相电压"}, 506 | "16878":{"name":"AC_UB","type":"DECIMAL","description":"401-1N 电网B相电压"}, 507 | "16879":{"name":"AC_UC","type":"DECIMAL","description":"401-1N 电网C相电压"}, 508 | "16880":{"name":"AC_IA","type":"DECIMAL","description":"401-1N 电网A相电流"}, 509 | "16881":{"name":"AC_IB","type":"DECIMAL","description":"401-1N 电网B相电流"}, 510 | "16882":{"name":"AC_IC","type":"DECIMAL","description":"401-1N 电网C相电流"}, 511 | "16883":{"name":"GRID_FRQ","type":"DECIMAL","description":"401-1N 电网频率"}, 512 | "16884":{"name":"","type":"DECIMAL","description":"401-1N 功率因数"}, 513 | "16885":{"name":"CONVERT_EFF","type":"DECIMAL","description":"401-1N 效率"}, 514 | "16886":{"name":"MACHINE_TEMP","type":"DECIMAL","description":"401-1N 机内温度"}, 515 | "16887":{"name":"WARNING_STATUS","type":"int","description":"401-1N 逆变器状态"}, 516 | "16888":{"name":"PEAK_POWER","type":"DECIMAL","description":"401-1N 当天峰值有功功率"}, 517 | "16889":{"name":"OUTPUT_P","type":"DECIMAL","description":"401-1N 有功功率"}, 518 | "16890":{"name":"REACTIVE_P","type":"DECIMAL","description":"401-1N 无功功率"}, 519 | "16891":{"name":"CONNECT_P","type":"DECIMAL","description":"401-1N 输入功率"}, 520 | "16892":{"name":"","type":"DECIMAL","description":"401-1N 当前发电量统计时间"}, 521 | "16893":{"name":"ELEC_PROD_HOUR","type":"DECIMAL","description":"401-1N 当前小时发电量"}, 522 | "16894":{"name":"ELEC_PROD_DAILY","type":"DECIMAL","description":"401-1N 当前日发电量"}, 523 | "16895":{"name":"ELEC_PROD_MONTH","type":"DECIMAL","description":"401-1N 当前月发电量"}, 524 | "16896":{"name":"ELEC_PROD_YEAR","type":"DECIMAL","description":"401-1N 当前年发电量"}, 525 | "16897":{"name":"ELEC_PROD_ALL","type":"DECIMAL","description":"401-1N 总发电量"}, 526 | "16898":{"name":"PV7_U","type":"DECIMAL","description":"401-1N PV7输入电压"}, 527 | "16899":{"name":"PV7_I","type":"DECIMAL","description":"401-1N PV7输入电流"}, 528 | "16900":{"name":"PV8_U","type":"DECIMAL","description":"401-1N PV8输入电压"}, 529 | "16901":{"name":"PV8_I","type":"DECIMAL","description":"401-1N PV8输入电流"}, 530 | "16902":{"name":"PV_CONNECT_STATUS","type":"int","description":"401-1N 闭锁状态"}, 531 | "16903":{"name":"","type":"DECIMAL","description":"401-1N 零电压穿越保护状态"}, 532 | "16904":{"name":"","type":"DECIMAL","description":"401-1N 低电压穿越保护状态"}, 533 | "16905":{"name":"","type":"DECIMAL","description":"401-1N 孤岛效应保护状态"}, 534 | "16906":{"name":"CONNECT_STATUS","type":"int","description":"401-1N 并网状态"}, 535 | "16907":{"name":"","type":"DECIMAL","description":"401-1N 绝缘阻抗值"}, 536 | "16908":{"name":"","type":"DECIMAL","description":"401-1N 开机时间"}, 537 | "16909":{"name":"","type":"DECIMAL","description":"401-1N 关机时间"} 538 | } -------------------------------------------------------------------------------- /src/main/java/com/visenergy/iec104/YcObject.java: -------------------------------------------------------------------------------- 1 | package com.visenergy.iec104; 2 | 3 | import com.flying.jdbc.SqlHelper; 4 | import com.flying.jdbc.data.CommandType; 5 | import com.flying.jdbc.data.Parameter; 6 | import com.flying.jdbc.db.type.BaseTypes; 7 | import com.flying.jdbc.util.DBConnection; 8 | import com.rabbitmq.client.Channel; 9 | import com.rabbitmq.client.Connection; 10 | import com.visenergy.iec104.util.RabbitMqUtils; 11 | import net.sf.json.JSONObject; 12 | import org.apache.commons.collections.map.HashedMap; 13 | import org.apache.commons.logging.Log; 14 | import org.apache.commons.logging.LogFactory; 15 | 16 | import java.io.IOException; 17 | import java.math.BigDecimal; 18 | import java.sql.Timestamp; 19 | import java.util.*; 20 | import java.util.concurrent.*; 21 | 22 | /** 23 | * Created by zhonghuan on 2017/7/25. 24 | */ 25 | public class YcObject { 26 | private Log log = LogFactory.getLog(YcObject.class); 27 | 28 | private static String RABBITMQ_QUEUE = "PV_YC"; 29 | 30 | private String ID; 31 | private String INVERTER_ID; 32 | private String SERIAL; 33 | private double ELEC_PROD_HOUR=0; 34 | private double ELEC_PROD_DAILY=0; 35 | private double ELEC_PROD_MONTH=0; 36 | private double ELEC_PROD_YEAR=0; 37 | private double ELEC_PROD_ALL=0; 38 | private double OUTPUT_P=0; 39 | private double CONNECT_P=0; 40 | private double PEAK_POWER=0; 41 | private double REACTIVE_P=0; 42 | private double PV1_U=0; 43 | private double PV1_I=0; 44 | private double PV2_U=0; 45 | private double PV2_I=0; 46 | private double PV3_U=0; 47 | private double PV3_I=0; 48 | private double PV4_U=0; 49 | private double PV4_I=0; 50 | private double PV5_U=0; 51 | private double PV5_I=0; 52 | private double PV6_U=0; 53 | private double PV6_I=0; 54 | private double PV7_U=0; 55 | private double PV7_I=0; 56 | private double PV8_U=0; 57 | private double PV8_I=0; 58 | private double AC_UA=0; 59 | private double AC_UB=0; 60 | private double AC_UC=0; 61 | private double AC_IA=0; 62 | private double AC_IB=0; 63 | private double AC_IC=0; 64 | private double MACHINE_TEMP=0; 65 | private double GRID_FRQ=0; 66 | private double CONVERT_EFF=0; 67 | private double CO2_CUTS=0; 68 | private double COAL_SAVE=0; 69 | private double CONVERT_BENF=0; 70 | private int CONNECT_STATUS=0; 71 | private int PV_CONNECT_STATUS=0; 72 | private int WARNING_STATUS=0; 73 | private double AMBIENT_TEMP=0; //环境温度 74 | private double RADIANT_QUANTITY_1=0; //辐射量1 75 | private double IRRADIANCE_1=0; //辐照度1 76 | private double RADIANT_QUANTITY_2=0; //辐射量2 77 | private double IRRADIANCE_2=0; //辐照度2 78 | private double DAMPNESS=0; //湿度 79 | private double PRESSURE=0; //压力 80 | private double WIND_SPEED=0; //风速 81 | private double WIND_DIR=0; //风向 82 | private double FULL_HOURS_DAY=0; //日满发小时数 83 | private double FULL_HOURS_MON=0; //月满发小时数 84 | private double FULL_HOURS_YEAR=0; //年满发小时数 85 | private double FULL_HOURS_ALL=0; //累计满发小时数 86 | private boolean flag=false; 87 | 88 | private Connection conn = null; 89 | private Channel channel = null; 90 | 91 | public YcObject(String inverterId,String serial){ 92 | this.INVERTER_ID = inverterId; 93 | this.SERIAL = serial; 94 | 95 | //初始化rabbitmq 96 | try { 97 | this.getChannel(); 98 | } catch (IOException e) { 99 | log.error("初始化rabbitMq失败",e); 100 | } catch (TimeoutException e) { 101 | log.error("初始化rabbitMq失败",e); 102 | } 103 | 104 | Runnable runnable = new Runnable() { 105 | 106 | public void run() { 107 | if(flag==true){ 108 | //逆变器数据采集表(历史表)插入语句 109 | String sql = "INSERT INTO T_PVMANAGE_INVERTER_COLLECT(INVERTER_ID,ELEC_PROD_HOUR,ELEC_PROD_DAILY," + 110 | "ELEC_PROD_MONTH,ELEC_PROD_YEAR,ELEC_PROD_ALL,OUTPUT_P,CONNECT_P,PEAK_POWER,REACTIVE_P," + 111 | "PV1_U,PV1_I,PV2_U,PV2_I,PV3_U,PV3_I,PV4_U,PV4_I,PV5_U,PV5_I,PV6_U,PV6_I,PV7_U,PV7_I,PV8_U,PV8_I," + 112 | "AC_UA,AC_UB,AC_UC,AC_IA,AC_IB,AC_IC,MACHINE_TEMP,GRID_FRQ,CONVERT_EFF,CO2_CUTS," + 113 | "COAL_SAVE,CONVERT_BENF,CONNECT_STATUS,PV_CONNECT_STATUS,WARNING_STATUS,AMBIENT_TEMP," + 114 | "RADIANT_QUANTITY_1,IRRADIANCE_1,RADIANT_QUANTITY_2,IRRADIANCE_2,DAMPNESS,PRESSURE,WIND_SPEED,WIND_DIR," + 115 | "FULL_HOURS_DAY,FULL_HOURS_MON,FULL_HOURS_YEAR,FULL_HOURS_ALL) " + 116 | "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; 117 | //逆变器实时数据表更新语句 118 | String inverter_data_now = "UPDATE T_PVMANAGE_INVERTER_COLLECT_C SET ELEC_PROD_HOUR=?,ELEC_PROD_DAILY=?," + 119 | "ELEC_PROD_MONTH=?,ELEC_PROD_YEAR=?,ELEC_PROD_ALL=?,OUTPUT_P=?,CONNECT_P=?,PEAK_POWER=?," + 120 | "REACTIVE_P=?,PV1_U=?,PV1_I=?,PV2_U=?,PV2_I=?,PV3_U=?,PV3_I=?,PV4_U=?,PV4_I=?,PV5_U=?,PV5_I=?," + 121 | "PV6_U=?,PV6_I=?,PV7_U=?,PV7_I=?,PV8_U=?,PV8_I=?,AC_UA=?,AC_UB=?,AC_UC=?,AC_IA=?,AC_IB=?,AC_IC=?," + 122 | "MACHINE_TEMP=?,GRID_FRQ=?,CONVERT_EFF=?,CO2_CUTS=?,COAL_SAVE=?,CONVERT_BENF=?,AMBIENT_TEMP=?," + 123 | "RADIANT_QUANTITY_1=?,IRRADIANCE_1=?,RADIANT_QUANTITY_2=?,IRRADIANCE_2=?,DAMPNESS=?,PRESSURE=?,WIND_SPEED=?,WIND_DIR=?," + 124 | "FULL_HOURS_DAY=?,FULL_HOURS_MON=?,FULL_HOURS_YEAR=?,FULL_HOURS_ALL=?,TIME=? " + 125 | "WHERE INVERTER_ID = ?"; 126 | //环境数据采集 127 | String metero_sql = "INSERT INTO T_PVMANAGE_METERO(WIND_SPEED,WIND_DIREC,PANEL_TEMP,AMBIEN_TEMP,RADIANT_QUANTITY_1,IRRADIANCE_1," + 128 | "RADIANT_QUANTITY_2,IRRADIANCE_2,DAMPNESS,PRESSURE) VALUES(?,?,?,?,?,?,?,?,?,?)"; 129 | 130 | DBConnection conn = SqlHelper.connPool.getConnection(); 131 | Parameter[] params = new Parameter[54]; 132 | Parameter[] params_new_data = new Parameter[52]; 133 | Parameter[] params_metero_data = new Parameter[10]; 134 | 135 | //逆变器数据采集历史表 136 | COAL_SAVE = ELEC_PROD_ALL*0.4; 137 | CONVERT_BENF = (0.42+0.3)*ELEC_PROD_YEAR; 138 | if ("1820FB1857737B3BA33A8FEE25164C98".equals(inverterId) || "4D5F552ED8CC4EE981720CBDDB7FEAC6".equals(inverterId)){ 139 | FULL_HOURS_DAY = ELEC_PROD_DAILY/41.58; 140 | FULL_HOURS_MON = ELEC_PROD_MONTH/41.58; 141 | FULL_HOURS_YEAR = ELEC_PROD_YEAR/41.58; 142 | FULL_HOURS_ALL = ELEC_PROD_ALL/41.58; 143 | }else if ("6E5CEB1058E8A530A499DDC363A134C7".equals(inverterId)){ 144 | FULL_HOURS_DAY = ELEC_PROD_DAILY/21.6; 145 | FULL_HOURS_MON = ELEC_PROD_MONTH/21.6; 146 | FULL_HOURS_YEAR = ELEC_PROD_YEAR/21.6; 147 | FULL_HOURS_ALL = ELEC_PROD_ALL/21.6; 148 | }else if ("6F31267F133D958AA4865C81AEA23225".equals(inverterId)){ 149 | FULL_HOURS_DAY = ELEC_PROD_DAILY/38.88; 150 | FULL_HOURS_MON = ELEC_PROD_MONTH/38.88; 151 | FULL_HOURS_YEAR = ELEC_PROD_YEAR/38.88; 152 | FULL_HOURS_ALL = ELEC_PROD_ALL/38.88; 153 | }else if ("7CBE845153C74C3B798618B7F1F81D9D".equals(inverterId) || "FB003754389C03E09BAC593D694102E8".equals(inverterId) || 154 | "FC8FC785AE2E7CF450BCFC876DABE6D8".equals(inverterId)){ 155 | FULL_HOURS_DAY = ELEC_PROD_DAILY/29.7; 156 | FULL_HOURS_MON = ELEC_PROD_MONTH/29.7; 157 | FULL_HOURS_YEAR = ELEC_PROD_YEAR/29.7; 158 | FULL_HOURS_ALL = ELEC_PROD_ALL/29.7; 159 | }else if ("977767AE5E946563CA859C0AA980FA39".equals(inverterId)){ 160 | FULL_HOURS_DAY = ELEC_PROD_DAILY/17.82; 161 | FULL_HOURS_MON = ELEC_PROD_MONTH/17.82; 162 | FULL_HOURS_YEAR = ELEC_PROD_YEAR/17.82; 163 | FULL_HOURS_ALL = ELEC_PROD_ALL/17.82; 164 | }else if ("AAA263543DC49259EBAED22960B4271F".equals(inverterId)){ 165 | FULL_HOURS_DAY = ELEC_PROD_DAILY/18.15; 166 | FULL_HOURS_MON = ELEC_PROD_MONTH/18.15; 167 | FULL_HOURS_YEAR = ELEC_PROD_YEAR/18.15; 168 | FULL_HOURS_ALL = ELEC_PROD_ALL/18.15; 169 | }else if ("C697C5B7684DFC9E10045763AD9721F3".equals(inverterId)){ 170 | FULL_HOURS_DAY = ELEC_PROD_DAILY/18; 171 | FULL_HOURS_MON = ELEC_PROD_MONTH/18; 172 | FULL_HOURS_YEAR = ELEC_PROD_YEAR/18; 173 | FULL_HOURS_ALL = ELEC_PROD_ALL/18; 174 | }else { 175 | FULL_HOURS_DAY = ELEC_PROD_DAILY/16.2; 176 | FULL_HOURS_MON = ELEC_PROD_MONTH/16.2; 177 | FULL_HOURS_YEAR = ELEC_PROD_YEAR/16.2; 178 | FULL_HOURS_ALL = ELEC_PROD_ALL/16.2; 179 | } 180 | 181 | params[0] = new Parameter("INVERTER_ID", BaseTypes.VARCHAR,INVERTER_ID); 182 | params[1] = new Parameter("ELEC_PROD_HOUR", BaseTypes.DECIMAL,new BigDecimal(ELEC_PROD_HOUR).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 183 | params[2] = new Parameter("ELEC_PROD_DAILY", BaseTypes.DECIMAL,new BigDecimal(ELEC_PROD_DAILY).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 184 | params[3] = new Parameter("ELEC_PROD_MONTH", BaseTypes.DECIMAL,new BigDecimal(ELEC_PROD_MONTH).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 185 | params[4] = new Parameter("ELEC_PROD_YEAR", BaseTypes.DECIMAL,new BigDecimal(ELEC_PROD_YEAR).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 186 | params[5] = new Parameter("ELEC_PROD_ALL", BaseTypes.DECIMAL,new BigDecimal(ELEC_PROD_ALL).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 187 | params[6] = new Parameter("OUTPUT_P", BaseTypes.DECIMAL,new BigDecimal(OUTPUT_P).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 188 | params[7] = new Parameter("CONNECT_P", BaseTypes.DECIMAL,new BigDecimal(CONNECT_P).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 189 | params[8] = new Parameter("PEAK_POWER", BaseTypes.DECIMAL,new BigDecimal(PEAK_POWER).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue() ); 190 | params[9] = new Parameter("REACTIVE_P", BaseTypes.DECIMAL,new BigDecimal(REACTIVE_P).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 191 | params[10] = new Parameter("PV1_U", BaseTypes.DECIMAL,new BigDecimal(PV1_U).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 192 | params[11] = new Parameter("PV1_I", BaseTypes.DECIMAL,new BigDecimal(PV1_I).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 193 | params[12] = new Parameter("PV2_U", BaseTypes.DECIMAL,new BigDecimal(PV2_U).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 194 | params[13] = new Parameter("PV2_I", BaseTypes.DECIMAL,new BigDecimal(PV2_I).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 195 | params[14] = new Parameter("PV3_U", BaseTypes.DECIMAL,new BigDecimal(PV3_U).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 196 | params[15] = new Parameter("PV3_I", BaseTypes.DECIMAL,new BigDecimal(PV3_I).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 197 | params[16] = new Parameter("PV4_U", BaseTypes.DECIMAL,new BigDecimal(PV4_U).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 198 | params[17] = new Parameter("PV4_I", BaseTypes.DECIMAL,new BigDecimal(PV4_I).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 199 | params[18] = new Parameter("PV5_U", BaseTypes.DECIMAL,new BigDecimal(PV5_U).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 200 | params[19] = new Parameter("PV5_I", BaseTypes.DECIMAL,new BigDecimal(PV5_I).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 201 | params[20] = new Parameter("PV6_U", BaseTypes.DECIMAL,new BigDecimal(PV6_U).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 202 | params[21] = new Parameter("PV6_I", BaseTypes.DECIMAL,new BigDecimal(PV6_I).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 203 | params[22] = new Parameter("PV7_U", BaseTypes.DECIMAL,new BigDecimal(PV7_U).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 204 | params[23] = new Parameter("PV7_I", BaseTypes.DECIMAL,new BigDecimal(PV7_I).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 205 | params[24] = new Parameter("PV8_U", BaseTypes.DECIMAL,new BigDecimal(PV8_U).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 206 | params[25] = new Parameter("PV8_I", BaseTypes.DECIMAL,new BigDecimal(PV8_I).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 207 | params[26] = new Parameter("AC_UA", BaseTypes.DECIMAL,new BigDecimal(AC_UA).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 208 | params[27] = new Parameter("AC_UB", BaseTypes.DECIMAL,new BigDecimal(AC_UB).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 209 | params[28] = new Parameter("AC_UC", BaseTypes.DECIMAL,new BigDecimal(AC_UC).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 210 | params[29] = new Parameter("AC_IA", BaseTypes.DECIMAL,new BigDecimal(AC_IA).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 211 | params[30] = new Parameter("AC_IB", BaseTypes.DECIMAL,new BigDecimal(AC_IB).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 212 | params[31] = new Parameter("AC_IC", BaseTypes.DECIMAL,new BigDecimal(AC_IC).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 213 | params[32] = new Parameter("MACHINE_TEMP",BaseTypes.DECIMAL, new BigDecimal(MACHINE_TEMP).setScale(1,BigDecimal.ROUND_HALF_UP).doubleValue()); 214 | params[33] = new Parameter("GRID_FRQ", BaseTypes.DECIMAL,new BigDecimal(GRID_FRQ).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 215 | params[34] = new Parameter("CONVERT_EFF", BaseTypes.DECIMAL,new BigDecimal(CONVERT_EFF).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 216 | params[35] = new Parameter("CO2_CUTS", BaseTypes.DECIMAL,new BigDecimal(CO2_CUTS).setScale(3,BigDecimal.ROUND_HALF_UP).doubleValue()); 217 | params[36] = new Parameter("COAL_SAVE", BaseTypes.DECIMAL,new BigDecimal(COAL_SAVE).setScale(3,BigDecimal.ROUND_HALF_UP).doubleValue()); 218 | params[37] = new Parameter("CONVERT_BENF", BaseTypes.DECIMAL,new BigDecimal(CONVERT_BENF).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue()); 219 | params[38] = new Parameter("CONNECT_STATUS", BaseTypes.INTEGER,CONNECT_STATUS); 220 | params[39] = new Parameter("PV_CONNECT_STATUS", BaseTypes.INTEGER,PV_CONNECT_STATUS); 221 | params[40] = new Parameter("WARNING_STATUS", BaseTypes.INTEGER,WARNING_STATUS); 222 | params[41] = new Parameter("AMBIENT_TEMP",BaseTypes.DECIMAL,new BigDecimal(AMBIENT_TEMP).setScale(1,BigDecimal.ROUND_HALF_UP).doubleValue() ); 223 | params[42] = new Parameter("RADIANT_QUANTITY_1", BaseTypes.DECIMAL,new BigDecimal(RADIANT_QUANTITY_1).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 224 | params[43] = new Parameter("IRRADIANCE_1",BaseTypes.DECIMAL,new BigDecimal(IRRADIANCE_1).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue() ); 225 | params[44] = new Parameter("RADIANT_QUANTITY_2", BaseTypes.DECIMAL,new BigDecimal(RADIANT_QUANTITY_2).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 226 | params[45] = new Parameter("IRRADIANCE_2",BaseTypes.DECIMAL,new BigDecimal(IRRADIANCE_1).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue() ); 227 | params[46] = new Parameter("DAMPNESS",BaseTypes.DECIMAL,new BigDecimal(DAMPNESS).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 228 | params[47] = new Parameter("PRESSURE",BaseTypes.DECIMAL,new BigDecimal(PRESSURE).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 229 | params[48] = new Parameter("WIND_SPEED",BaseTypes.DECIMAL,new BigDecimal(WIND_SPEED).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 230 | params[49] = new Parameter("WIND_DIR",BaseTypes.DECIMAL,new BigDecimal(WIND_DIR).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 231 | params[50] = new Parameter("FULL_HOURS_DAY",BaseTypes.DECIMAL,new BigDecimal(FULL_HOURS_DAY).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 232 | params[51] = new Parameter("FULL_HOURS_MON",BaseTypes.DECIMAL,new BigDecimal(FULL_HOURS_MON).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 233 | params[52] = new Parameter("FULL_HOURS_YEAR",BaseTypes.DECIMAL,new BigDecimal(FULL_HOURS_YEAR).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 234 | params[53] = new Parameter("FULL_HOURS_ALL",BaseTypes.DECIMAL,new BigDecimal(FULL_HOURS_ALL).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 235 | 236 | //将数据存入逆变器实时数据表 237 | params_new_data[0] = params[1]; 238 | params_new_data[1] = params[2]; 239 | params_new_data[2] = params[3]; 240 | params_new_data[3] = params[4]; 241 | params_new_data[4] = params[5]; 242 | params_new_data[5] = params[6]; 243 | params_new_data[6] = params[7]; 244 | params_new_data[7] = params[8]; 245 | params_new_data[8] = params[9]; 246 | params_new_data[9] = params[10]; 247 | params_new_data[10] = params[11]; 248 | params_new_data[11] = params[12]; 249 | params_new_data[12] = params[13]; 250 | params_new_data[13] = params[14]; 251 | params_new_data[14] = params[15]; 252 | params_new_data[15] = params[16]; 253 | params_new_data[16] = params[17]; 254 | params_new_data[17] = params[18]; 255 | params_new_data[18] = params[19]; 256 | params_new_data[19] = params[20]; 257 | params_new_data[20] = params[21]; 258 | params_new_data[21] = params[22]; 259 | params_new_data[22] = params[23]; 260 | params_new_data[23] = params[24]; 261 | params_new_data[24] = params[25]; 262 | params_new_data[25] = params[26]; 263 | params_new_data[26] = params[27]; 264 | params_new_data[27] = params[28]; 265 | params_new_data[28] = params[29]; 266 | params_new_data[29] = params[30]; 267 | params_new_data[30] = params[31]; 268 | params_new_data[31] = params[32]; 269 | params_new_data[32] = params[33]; 270 | params_new_data[33] = params[34]; 271 | params_new_data[34] = params[35]; 272 | params_new_data[35] = params[36]; 273 | params_new_data[36] = params[37]; 274 | params_new_data[37] = params[38]; 275 | params_new_data[38] = params[42]; 276 | params_new_data[39] = params[43]; 277 | params_new_data[40] = params[44]; 278 | params_new_data[41] = params[45]; 279 | params_new_data[42] = params[46]; 280 | params_new_data[43] = params[47]; 281 | params_new_data[44] = params[48]; 282 | params_new_data[45] = params[49]; 283 | params_new_data[46] = params[50]; 284 | params_new_data[47] = params[51]; 285 | params_new_data[48] = params[52]; 286 | params_new_data[49] = params[53]; 287 | params_new_data[50] = new Parameter("TIME", BaseTypes.TIMESTAMP,new Timestamp(System.currentTimeMillis())); 288 | params_new_data[51] = params[0]; 289 | 290 | //气象数据 291 | params_metero_data[0] = params[48]; 292 | params_metero_data[1] = params[49]; 293 | params_metero_data[2] = params[32]; 294 | params_metero_data[3] = params[41]; 295 | params_metero_data[4] = params[42]; 296 | params_metero_data[5] = params[43]; 297 | params_metero_data[6] = params[44]; 298 | params_metero_data[7] = params[45]; 299 | params_metero_data[8] = params[46]; 300 | params_metero_data[9] = params[47]; 301 | 302 | try { 303 | SqlHelper.executeNonQuery(conn, CommandType.Text, sql, params); 304 | //将最新数据更新到逆变器实时数据表 305 | SqlHelper.executeNonQuery(conn, CommandType.Text, inverter_data_now, params_new_data); 306 | //插入环境仪采集数据 307 | SqlHelper.executeNonQuery(conn, CommandType.Text, metero_sql, params_metero_data); 308 | // clear(); 309 | } catch (Exception e) { 310 | e.printStackTrace(); 311 | } 312 | SqlHelper.connPool.releaseConnection(conn); 313 | }else{ 314 | log.debug("未接收到数据"); 315 | } 316 | } 317 | }; 318 | ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor(); 319 | service.scheduleAtFixedRate(runnable,120,300, TimeUnit.SECONDS); 320 | } 321 | 322 | public void clear(){ 323 | ELEC_PROD_HOUR=0; 324 | ELEC_PROD_DAILY=0; 325 | ELEC_PROD_MONTH=0; 326 | ELEC_PROD_YEAR=0; 327 | ELEC_PROD_ALL=0; 328 | OUTPUT_P=0; 329 | CONNECT_P=0; 330 | PEAK_POWER=0; 331 | REACTIVE_P=0; 332 | PV1_U=0; 333 | PV1_I=0; 334 | PV2_U=0; 335 | PV2_I=0; 336 | PV3_U=0; 337 | PV3_I=0; 338 | PV4_U=0; 339 | PV4_I=0; 340 | PV5_U=0; 341 | PV5_I=0; 342 | PV6_U=0; 343 | PV6_I=0; 344 | PV7_U=0; 345 | PV7_I=0; 346 | PV8_U=0; 347 | PV8_I=0; 348 | AC_UA=0; 349 | AC_UB=0; 350 | AC_UC=0; 351 | AC_IA=0; 352 | AC_IB=0; 353 | AC_IC=0; 354 | MACHINE_TEMP=0; 355 | GRID_FRQ=0; 356 | CONVERT_EFF=0; 357 | CO2_CUTS=0; 358 | COAL_SAVE=0; 359 | CONVERT_BENF=0; 360 | CONNECT_STATUS=0; 361 | PV_CONNECT_STATUS=0; 362 | WARNING_STATUS=0; 363 | AMBIENT_TEMP=0; 364 | RADIANT_QUANTITY_1=0; 365 | IRRADIANCE_1=0; 366 | RADIANT_QUANTITY_2=0; 367 | IRRADIANCE_2=0; 368 | DAMPNESS=0; 369 | PRESSURE=0; 370 | WIND_SPEED=0; 371 | WIND_DIR=0; 372 | this.flag=false; 373 | } 374 | 375 | public JSONObject toJsonString(){ 376 | Map map = new HashMap(); 377 | map.put("INVERTER_ID", INVERTER_ID); 378 | map.put("ELEC_PROD_HOUR", ELEC_PROD_HOUR); 379 | map.put("ELEC_PROD_DAILY", ELEC_PROD_DAILY); 380 | map.put("ELEC_PROD_ALL", ELEC_PROD_ALL); 381 | map.put("OUTPUT_P", OUTPUT_P); 382 | map.put("CONNECT_P", CONNECT_P); 383 | map.put("PEAK_POWER", PEAK_POWER); 384 | map.put("REACTIVE_P", REACTIVE_P); 385 | map.put("PV1_U", PV1_U); 386 | map.put("PV1_I", PV1_I); 387 | map.put("PV2_U", PV2_U); 388 | map.put("PV2_I", PV2_I); 389 | map.put("PV3_U", PV3_U); 390 | map.put("PV3_I", PV3_I); 391 | map.put("PV4_U", PV4_U); 392 | map.put("PV4_I", PV4_I); 393 | map.put("PV5_U", PV5_U); 394 | map.put("PV5_I", PV5_I); 395 | map.put("PV6_U", PV6_U); 396 | map.put("PV6_I", PV6_I); 397 | map.put("PV7_U", PV7_U); 398 | map.put("PV7_I", PV7_I); 399 | map.put("PV8_U", PV8_U); 400 | map.put("PV8_I", PV8_I); 401 | map.put("AC_UA", AC_UA); 402 | map.put("AC_UB", AC_UB); 403 | map.put("AC_UC", AC_UC); 404 | map.put("AC_IA", AC_IA); 405 | map.put("AC_IB", AC_IB); 406 | map.put("AC_IC", AC_IC); 407 | map.put("MACHINE_TEMP", MACHINE_TEMP); 408 | map.put("GRID_FRQ", GRID_FRQ); 409 | map.put("CONVERT_EFF", CONVERT_EFF); 410 | map.put("CO2_CUTS", CO2_CUTS); 411 | map.put("COAL_SAVE", COAL_SAVE); 412 | map.put("CONVERT_BENF", CONVERT_BENF); 413 | map.put("AMBIENT_TEMP", AMBIENT_TEMP); 414 | map.put("RADIANT_QUANTITY_1", RADIANT_QUANTITY_1); 415 | map.put("IRRADIANCE_1", IRRADIANCE_1); 416 | map.put("RADIANT_QUANTITY_2", RADIANT_QUANTITY_2); 417 | map.put("IRRADIANCE_2", IRRADIANCE_2); 418 | map.put("DAMPNESS", DAMPNESS); 419 | map.put("PRESSURE", PRESSURE); 420 | map.put("WIND_SPEED", WIND_SPEED); 421 | map.put("WIND_DIR", WIND_DIR); 422 | JSONObject jsonObject = JSONObject.fromObject(map); 423 | return jsonObject; 424 | } 425 | 426 | public String getID() { 427 | return ID; 428 | } 429 | 430 | public void setID(String ID) { 431 | this.ID = ID; 432 | this.flag=true; 433 | } 434 | 435 | public String getINVERTER_ID() { 436 | return INVERTER_ID; 437 | } 438 | 439 | public void setINVERTER_ID(String INVERTER_ID) { 440 | this.INVERTER_ID = INVERTER_ID; 441 | this.flag=true; 442 | } 443 | 444 | public String getSERIAL() { 445 | return SERIAL; 446 | } 447 | 448 | public void setSERIAL(String SERIAL) { 449 | this.SERIAL = SERIAL; 450 | } 451 | 452 | public double getELEC_PROD_HOUR() { 453 | return ELEC_PROD_HOUR; 454 | } 455 | 456 | public void setELEC_PROD_HOUR(double ELEC_PROD_HOUR) { 457 | this.ELEC_PROD_HOUR = ELEC_PROD_HOUR; 458 | this.flag=true; 459 | this.sendRabbitMq("SERIAL","ELEC_PROD_HOUR",new BigDecimal(ELEC_PROD_HOUR).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 460 | } 461 | 462 | public double getELEC_PROD_DAILY() { 463 | return ELEC_PROD_DAILY; 464 | } 465 | 466 | public void setELEC_PROD_DAILY(double ELEC_PROD_DAILY) { 467 | this.ELEC_PROD_DAILY = ELEC_PROD_DAILY; 468 | this.flag=true; 469 | this.sendRabbitMq("SERIAL","ELEC_PROD_DAILY",new BigDecimal(ELEC_PROD_DAILY).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 470 | } 471 | 472 | public double getELEC_PROD_MONTH() { 473 | return ELEC_PROD_MONTH; 474 | } 475 | 476 | public void setELEC_PROD_MONTH(double ELEC_PROD_MONTH) { 477 | this.ELEC_PROD_MONTH = ELEC_PROD_MONTH; 478 | this.flag=true; 479 | this.sendRabbitMq("SERIAL","ELEC_PROD_MONTH",new BigDecimal(ELEC_PROD_MONTH).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 480 | } 481 | 482 | public double getELEC_PROD_YEAR() { 483 | return ELEC_PROD_YEAR; 484 | } 485 | 486 | public void setELEC_PROD_YEAR(double ELEC_PROD_YEAR) { 487 | this.ELEC_PROD_YEAR = ELEC_PROD_YEAR; 488 | this.flag=true; 489 | this.sendRabbitMq("SERIAL","ELEC_PROD_YEAR",new BigDecimal(ELEC_PROD_YEAR).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 490 | } 491 | 492 | public double getELEC_PROD_ALL() { 493 | return ELEC_PROD_ALL; 494 | } 495 | 496 | public void setELEC_PROD_ALL(double ELEC_PROD_ALL) { 497 | this.ELEC_PROD_ALL = ELEC_PROD_ALL; 498 | this.flag=true; 499 | this.sendRabbitMq("SERIAL","ELEC_PROD_ALL",new BigDecimal(ELEC_PROD_ALL).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 500 | } 501 | 502 | public double getOUTPUT_P() { 503 | return OUTPUT_P; 504 | } 505 | 506 | public void setOUTPUT_P(double OUTPUT_P) { 507 | this.OUTPUT_P = OUTPUT_P; 508 | this.flag=true; 509 | this.sendRabbitMq("SERIAL","OUTPUT_P",new BigDecimal(OUTPUT_P).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 510 | 511 | } 512 | 513 | public double getCONNECT_P() { 514 | return CONNECT_P; 515 | } 516 | 517 | public void setCONNECT_P(double CONNECT_P) { 518 | this.CONNECT_P = CONNECT_P; 519 | this.flag=true; 520 | this.sendRabbitMq("SERIAL","CONNECT_P",new BigDecimal(CONNECT_P).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 521 | } 522 | 523 | public double getPEAK_POWER() { 524 | return PEAK_POWER; 525 | } 526 | 527 | public void setPEAK_POWER(double PEAK_POWER) { 528 | this.PEAK_POWER = PEAK_POWER; 529 | this.flag=true; 530 | this.sendRabbitMq("SERIAL","PEAK_POWER",new BigDecimal(PEAK_POWER).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 531 | } 532 | 533 | public double getREACTIVE_P() { 534 | return REACTIVE_P; 535 | } 536 | 537 | public void setREACTIVE_P(double REACTIVE_P) { 538 | this.REACTIVE_P = REACTIVE_P; 539 | this.flag=true; 540 | this.sendRabbitMq("SERIAL","REACTIVE_P",new BigDecimal(REACTIVE_P).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 541 | 542 | } 543 | 544 | public double getPV1_U() { 545 | return PV1_U; 546 | } 547 | 548 | public void setPV1_U(double PV1_U) { 549 | this.PV1_U = PV1_U; 550 | this.flag=true; 551 | this.sendRabbitMq("SERIAL","PV1_U",new BigDecimal(PV1_U).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 552 | } 553 | 554 | public double getPV1_I() { 555 | return PV1_I; 556 | } 557 | 558 | public void setPV1_I(double PV1_I) { 559 | this.PV1_I = PV1_I; 560 | this.flag=true; 561 | this.sendRabbitMq("SERIAL","PV1_I",new BigDecimal(PV1_I).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 562 | } 563 | 564 | public double getPV2_U() { 565 | return PV2_U; 566 | } 567 | 568 | public void setPV2_U(double PV2_U) { 569 | this.PV2_U = PV2_U; 570 | this.flag=true; 571 | } 572 | 573 | public double getPV2_I() { 574 | return PV2_I; 575 | } 576 | 577 | public void setPV2_I(double PV2_I) { 578 | this.PV2_I = PV2_I; 579 | this.flag=true; 580 | } 581 | 582 | public double getPV3_U() { 583 | return PV3_U; 584 | } 585 | 586 | public void setPV3_U(double PV3_U) { 587 | this.PV3_U = PV3_U; 588 | this.flag=true; 589 | } 590 | 591 | public double getPV3_I() { 592 | return PV3_I; 593 | } 594 | 595 | public void setPV3_I(double PV3_I) { 596 | this.PV3_I = PV3_I; 597 | this.flag=true; 598 | } 599 | 600 | public double getPV4_U() { 601 | return PV4_U; 602 | } 603 | 604 | public void setPV4_U(double PV4_U) { 605 | this.PV4_U = PV4_U; 606 | this.flag=true; 607 | } 608 | 609 | public double getPV4_I() { 610 | return PV4_I; 611 | } 612 | 613 | public void setPV4_I(double PV4_I) { 614 | this.PV4_I = PV4_I; 615 | this.flag=true; 616 | } 617 | 618 | public double getPV5_U() { 619 | return PV5_U; 620 | } 621 | 622 | public void setPV5_U(double PV5_U) { 623 | this.PV5_U = PV5_U; 624 | this.flag=true; 625 | } 626 | 627 | public double getPV5_I() { 628 | return PV5_I; 629 | } 630 | 631 | public void setPV5_I(double PV5_I) { 632 | this.PV5_I = PV5_I; 633 | this.flag=true; 634 | } 635 | 636 | public double getPV6_U() { 637 | return PV6_U; 638 | } 639 | 640 | public void setPV6_U(double PV6_U) { 641 | this.PV6_U = PV6_U; 642 | this.flag=true; 643 | } 644 | 645 | public double getPV6_I() { 646 | return PV6_I; 647 | } 648 | 649 | public void setPV6_I(double PV6_I) { 650 | this.PV6_I = PV6_I; 651 | this.flag=true; 652 | } 653 | 654 | public double getPV7_U() { 655 | return PV7_U; 656 | } 657 | 658 | public void setPV7_U(double PV7_U) { 659 | this.PV7_U = PV7_U; 660 | this.flag=true; 661 | } 662 | 663 | public double getPV7_I() { 664 | return PV7_I; 665 | } 666 | 667 | public void setPV7_I(double PV7_I) { 668 | this.PV7_I = PV7_I; 669 | this.flag=true; 670 | } 671 | 672 | public double getPV8_U() { 673 | return PV8_U; 674 | } 675 | 676 | public void setPV8_U(double PV8_U) { 677 | this.PV8_U = PV8_U; 678 | this.flag=true; 679 | } 680 | 681 | public double getPV8_I() { 682 | return PV8_I; 683 | } 684 | 685 | public void setPV8_I(double PV8_I) { 686 | this.PV8_I = PV8_I; 687 | this.flag=true; 688 | } 689 | 690 | public double getAC_UA() { 691 | return AC_UA; 692 | } 693 | 694 | public void setAC_UA(double AC_UA) { 695 | this.AC_UA = AC_UA; 696 | this.flag=true; 697 | this.sendRabbitMq("SERIAL","AC_UA",new BigDecimal(AC_UA).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 698 | } 699 | 700 | public double getAC_UB() { 701 | return AC_UB; 702 | } 703 | 704 | public void setAC_UB(double AC_UB) { 705 | this.AC_UB = AC_UB; 706 | this.flag=true; 707 | this.sendRabbitMq("SERIAL","AC_UB",new BigDecimal(AC_UB).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 708 | } 709 | 710 | public double getAC_UC() { 711 | return AC_UC; 712 | } 713 | 714 | public void setAC_UC(double AC_UC) { 715 | this.AC_UC = AC_UC; 716 | this.flag=true; 717 | this.sendRabbitMq("SERIAL","AC_UC",new BigDecimal(AC_UC).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 718 | } 719 | 720 | public double getAC_IA() { 721 | return AC_IA; 722 | } 723 | 724 | public void setAC_IA(double AC_IA) { 725 | this.AC_IA = AC_IA; 726 | this.flag=true; 727 | this.sendRabbitMq("SERIAL","AC_IA",new BigDecimal(AC_IA).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 728 | } 729 | 730 | public double getAC_IB() { 731 | return AC_IB; 732 | } 733 | 734 | public void setAC_IB(double AC_IB) { 735 | this.AC_IB = AC_IB; 736 | this.flag=true; 737 | this.sendRabbitMq("SERIAL","AC_IB",new BigDecimal(AC_IB).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 738 | } 739 | 740 | public double getAC_IC() { 741 | return AC_IC; 742 | } 743 | 744 | public void setAC_IC(double AC_IC) { 745 | this.AC_IC = AC_IC; 746 | this.flag=true; 747 | this.sendRabbitMq("SERIAL","AC_IC",new BigDecimal(AC_IC).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 748 | } 749 | 750 | public double getMACHINE_TEMP() { 751 | return MACHINE_TEMP; 752 | } 753 | 754 | public void setMACHINE_TEMP(double MACHINE_TEMP) { 755 | this.MACHINE_TEMP = MACHINE_TEMP; 756 | this.flag=true; 757 | this.sendRabbitMq("SERIAL","MACHINE_TEMP",new BigDecimal(MACHINE_TEMP).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 758 | } 759 | 760 | public double getGRID_FRQ() { 761 | return GRID_FRQ; 762 | } 763 | 764 | public void setGRID_FRQ(double GRID_FRQ) { 765 | this.GRID_FRQ = GRID_FRQ; 766 | this.flag=true; 767 | } 768 | 769 | public double getCONVERT_EFF() { 770 | return CONVERT_EFF; 771 | } 772 | 773 | public void setCONVERT_EFF(double CONVERT_EFF) { 774 | this.CONVERT_EFF = CONVERT_EFF; 775 | this.flag=true; 776 | this.sendRabbitMq("SERIAL","CONVERT_EFF",new BigDecimal(CONVERT_EFF).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 777 | 778 | } 779 | 780 | public double getCO2_CUTS() { 781 | return CO2_CUTS; 782 | } 783 | 784 | public void setCO2_CUTS(double CO2_CUTS) { 785 | this.CO2_CUTS = CO2_CUTS; 786 | this.flag=true; 787 | this.sendRabbitMq("SERIAL","CO2_CUTS",new BigDecimal(CO2_CUTS).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 788 | } 789 | 790 | public double getCOAL_SAVE() { 791 | return COAL_SAVE; 792 | } 793 | 794 | public void setCOAL_SAVE(double COAL_SAVE) { 795 | this.COAL_SAVE = COAL_SAVE; 796 | this.flag=true; 797 | } 798 | 799 | public double getCONVERT_BENF() { 800 | return CONVERT_BENF; 801 | } 802 | 803 | public void setCONVERT_BENF(double CONVERT_BENF) { 804 | this.CONVERT_BENF = CONVERT_BENF; 805 | this.flag=true; 806 | } 807 | 808 | public int getCONNECT_STATUS() { 809 | return CONNECT_STATUS; 810 | } 811 | 812 | public void setCONNECT_STATUS(int CONNECT_STATUS) { 813 | this.CONNECT_STATUS = CONNECT_STATUS; 814 | this.flag=true; 815 | } 816 | 817 | public int getPV_CONNECT_STATUS() { 818 | return PV_CONNECT_STATUS; 819 | } 820 | 821 | public void setPV_CONNECT_STATUS(int PV_CONNECT_STATUS) { 822 | this.PV_CONNECT_STATUS = PV_CONNECT_STATUS; 823 | this.flag=true; 824 | } 825 | 826 | public int getWARNING_STATUS() { 827 | return WARNING_STATUS; 828 | } 829 | 830 | public void setWARNING_STATUS(int WARNING_STATUS) { 831 | this.WARNING_STATUS = WARNING_STATUS; 832 | this.flag=true; 833 | } 834 | 835 | public double getAMBIENT_TEMP() { 836 | return AMBIENT_TEMP; 837 | } 838 | 839 | public void setAMBIENT_TEMP(double AMBIENT_TEMP) { 840 | this.AMBIENT_TEMP = AMBIENT_TEMP; 841 | this.flag=true; 842 | sendRabbitMq("AMBIENT_TEMP",new BigDecimal(AMBIENT_TEMP).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 843 | } 844 | 845 | public double getRADIANT_QUANTITY_1() { 846 | return RADIANT_QUANTITY_1; 847 | } 848 | 849 | public void setRADIANT_QUANTITY_1(double RADIANT_QUANTITY_1) { 850 | this.RADIANT_QUANTITY_1 = RADIANT_QUANTITY_1; 851 | this.flag=true; 852 | sendRabbitMq("RADIANT_QUANTITY_1",new BigDecimal(RADIANT_QUANTITY_1).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 853 | } 854 | 855 | public double getIRRADIANCE_1() { 856 | return IRRADIANCE_1; 857 | } 858 | 859 | public void setIRRADIANCE_1(double IRRADIANCE_1) { 860 | this.IRRADIANCE_1 = IRRADIANCE_1; 861 | this.flag=true; 862 | sendRabbitMq("IRRADIANCE_1",new BigDecimal(IRRADIANCE_1).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 863 | } 864 | 865 | public double getRADIANT_QUANTITY_2() { 866 | return RADIANT_QUANTITY_2; 867 | } 868 | 869 | public void setRADIANT_QUANTITY_2(double RADIANT_QUANTITY_2) { 870 | this.RADIANT_QUANTITY_2 = RADIANT_QUANTITY_2; 871 | this.flag=true; 872 | sendRabbitMq("RADIANT_QUANTITY_2",new BigDecimal(RADIANT_QUANTITY_2).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 873 | } 874 | 875 | public double getIRRADIANCE_2() { 876 | return IRRADIANCE_2; 877 | } 878 | 879 | public void setIRRADIANCE_2(double IRRADIANCE_2) { 880 | this.IRRADIANCE_2 = IRRADIANCE_2; 881 | this.flag=true; 882 | sendRabbitMq("IRRADIANCE_2",new BigDecimal(IRRADIANCE_2).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 883 | } 884 | 885 | public double getDAMPNESS() { 886 | return DAMPNESS; 887 | } 888 | 889 | public void setDAMPNESS(double DAMPNESS) { 890 | this.DAMPNESS = DAMPNESS; 891 | this.flag=true; 892 | sendRabbitMq("DAMPNESS",new BigDecimal(DAMPNESS).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 893 | } 894 | 895 | public double getPRESSURE() { 896 | return PRESSURE; 897 | } 898 | 899 | public void setPRESSURE(double PRESSURE) { 900 | this.PRESSURE = PRESSURE; 901 | this.flag=true; 902 | sendRabbitMq("PRESSURE",new BigDecimal(PRESSURE).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 903 | } 904 | 905 | public double getWIND_SPEED() { 906 | return WIND_SPEED; 907 | } 908 | 909 | public void setWIND_SPEED(double WIND_SPEED) { 910 | this.WIND_SPEED = WIND_SPEED; 911 | this.flag=true; 912 | sendRabbitMq("WIND_SPEED",new BigDecimal(WIND_SPEED).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 913 | } 914 | 915 | public double getWIND_DIR() { 916 | return WIND_DIR; 917 | } 918 | 919 | public void setWIND_DIR(double WIND_DIR) { 920 | this.WIND_DIR = WIND_DIR; 921 | this.flag=true; 922 | sendRabbitMq("WIND_DIR",new BigDecimal(WIND_DIR).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); 923 | } 924 | 925 | public double getFULL_HOURS_DAY() { 926 | return FULL_HOURS_DAY; 927 | } 928 | 929 | public void setFULL_HOURS_DAY(double FULL_HOURS_DAY) { 930 | this.FULL_HOURS_DAY = FULL_HOURS_DAY; 931 | this.flag=true; 932 | } 933 | 934 | public double getFULL_HOURS_MON() { 935 | return FULL_HOURS_MON; 936 | } 937 | 938 | public void setFULL_HOURS_MON(double FULL_HOURS_MON) { 939 | this.FULL_HOURS_MON = FULL_HOURS_MON; 940 | this.flag=true; 941 | } 942 | 943 | public double getFULL_HOURS_YEAR() { 944 | return FULL_HOURS_YEAR; 945 | } 946 | 947 | public void setFULL_HOURS_YEAR(double FULL_HOURS_YEAR) { 948 | this.FULL_HOURS_YEAR = FULL_HOURS_YEAR; 949 | this.flag=true; 950 | } 951 | 952 | public double getFULL_HOURS_ALL() { 953 | return FULL_HOURS_ALL; 954 | } 955 | 956 | public void setFULL_HOURS_ALL(double FULL_HOURS_ALL) { 957 | this.FULL_HOURS_ALL = FULL_HOURS_ALL; 958 | this.flag=true; 959 | } 960 | 961 | public Connection getConn() throws IOException, TimeoutException { 962 | if(conn == null){ 963 | conn = RabbitMqUtils.newConnection(); 964 | } 965 | return conn; 966 | } 967 | 968 | public Channel getChannel() throws IOException, TimeoutException { 969 | if(channel == null){ 970 | channel = getConn().createChannel(); 971 | } 972 | return channel; 973 | } 974 | 975 | public boolean isFlag() { 976 | return flag; 977 | } 978 | 979 | public void setFlag(boolean flag) { 980 | this.flag = flag; 981 | } 982 | 983 | public void sendRabbitMq(String name,Object value) { 984 | Map map = new HashedMap(); 985 | map.put(name,value); 986 | sendRabbitMq("lightTopology","topologyData",map); 987 | } 988 | 989 | public void sendRabbitMq(String ID,String name,Object value){ 990 | Map map = new HashedMap(); 991 | map.put("name",ID); 992 | map.put("SERIAL",getSERIAL()); 993 | map.put(name,value); 994 | sendRabbitMq("lightTopology","inverterData",map); 995 | } 996 | 997 | 998 | public void sendRabbitMq(String module,String subModule,Map dataMap){ 999 | Map resultMap = new HashedMap(); 1000 | resultMap.put("module",module); 1001 | resultMap.put("subModule",subModule); 1002 | resultMap.put("data",dataMap); 1003 | 1004 | try { 1005 | RabbitMqUtils.sendMq(channel,RABBITMQ_QUEUE,JSONObject.fromObject(resultMap).toString()); 1006 | } catch (IOException e) { 1007 | log.error("RabbitMq传输消息失败",e); 1008 | } catch (TimeoutException e) { 1009 | log.error("RabbitMq传输消息失败",e); 1010 | } 1011 | } 1012 | } --------------------------------------------------------------------------------