重庆定制需求
V6.110
1.当前设备的电源触发交流停电告警时,核容状态显示为停电放电
| | |
| | |
|
| | | 注意当前版本在设置紫晶组2的61850协转签名时用的 BTSE/
|
| | |
|
| | |
|
| | | 重庆定制需求
|
| | |
|
| | | V6.110
|
| | | 1.当前设备的电源触发交流停电告警时,核容状态显示为停电放电 |
| | | |
| | | 充放电数据记录逻辑:
|
| | | (1)放电数据记录逻辑如下
|
| | | ① 其中电池触发放电数据记录逻辑为:
|
| | |
| | | |
| | | <root> |
| | | <mysql_ramdb_recreate_en>false</mysql_ramdb_recreate_en> |
| | | <mysql_server_ip>127.0.0.1</mysql_server_ip> |
| | | <mysql_server_ip>192.168.10.79</mysql_server_ip> |
| | | <!--SOURCE_BATTDATA_TYPE_FBSDEV = 0--> |
| | | <!--SOURCE_BATTDATA_TYPE_SQLSERVER = 1--> |
| | | <!--SOURCE_BATTDATA_TYPE_C_INTERFACE = 2--> |
| | |
| | | |
| | | <root> |
| | | <mysql_ramdb_recreate_en>false</mysql_ramdb_recreate_en> |
| | | <mysql_server_ip>127.0.0.1</mysql_server_ip> |
| | | <mysql_server_ip>192.168.10.79</mysql_server_ip> |
| | | <!--SOURCE_BATTDATA_TYPE_FBSDEV = 0--> |
| | | <!--SOURCE_BATTDATA_TYPE_SQLSERVER = 1--> |
| | | <!--SOURCE_BATTDATA_TYPE_C_INTERFACE = 2--> |
| | |
| | | private boolean mIDCE8200_ConState = false;
|
| | | private int mIDCE8200CommTimeout = 0;
|
| | |
|
| | | public int StationId;
|
| | | public String StationId;
|
| | | public String StationName;
|
| | | public byte[] StationIp = new byte[4];
|
| | | public int BattGroupId = 0;
|
| | |
| | | sql.sqlMysqlUseDB(Sql_Mysql.DB_BATT_INF);
|
| | |
|
| | | String sql_str = "SELECT DISTINCT "
|
| | | + " FBSDeviceId,FBSDeviceIp,BattGroupName6,GroupIndexInFBSDevice,FBSDeviceName,sign_type,KeyID,"
|
| | | + " StationId,FBSDeviceId,FBSDeviceIp,BattGroupName6,GroupIndexInFBSDevice,FBSDeviceName,sign_type,KeyID,"
|
| | | + " BattGroupId,BattGroupNum,MonCount,BattFloatCurrent,FloatVolLevel,MonCapStd,MonVolStd"
|
| | | + " FROM " + Sql_Mysql.BattInf_Table
|
| | | + " WHERE FLOOR(FBSDeviceId/10000)=61850"
|
| | |
| | | }
|
| | | boolean batt_group_exist = false;
|
| | | //String reg_code = res.getString("BattGroupName6").trim();
|
| | | |
| | | String ukeyID = res.getString("KeyID").trim();
|
| | | String station_id = res.getString("StationId").trim();
|
| | | |
| | | float float_vol_lev = res.getFloat("FloatVolLevel");
|
| | | float float_curr_lev = res.getFloat("BattFloatCurrent");
|
| | | int GroupIndexInFBSDevice = res.getInt("GroupIndexInFBSDevice");
|
| | |
| | | if(rtdata.GroupIndexInFBSDevice < 0) {
|
| | | rtdata.GroupIndexInFBSDevice = 0;
|
| | | }
|
| | | |
| | | rtdata.StationId = station_id;
|
| | | rtdata.BattGroupId = res.getInt("BattGroupId");
|
| | | rtdata.BattGroupNum = res.getInt("BattGroupNum");
|
| | |
|
| | |
| | | }
|
| | | return ukeyID;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 查询电源实时状态
|
| | | * @param pool
|
| | | * @param param
|
| | | */
|
| | | public static void queryPwrdev_Acdcdata_Table(MysqlConnPool pool, FBS9100_StatAndParam param) {
|
| | | String sql_str = "SELECT is_acIn1_powerdown,is_acIn2_powerdown,PowerDeviceId FROM " + Sql_Mysql.Pwrdev_Acdcdata_Table + " WHERE PowerDeviceId = " + param.PowerDeviceId + " LIMIT 1";
|
| | | Sql_Mysql sql = new Sql_Mysql(pool);
|
| | | ResultSet res = null;
|
| | | try {
|
| | | res = sql.sqlMysqlQuery(sql_str);
|
| | | if(res.next()) {
|
| | | boolean powerdown1 = res.getBoolean("is_acIn1_powerdown");
|
| | | boolean powerdown2 = res.getBoolean("is_acIn2_powerdown");
|
| | | if(powerdown1 || powerdown2) {
|
| | | param.setPowerDown(true);
|
| | | }else {
|
| | | param.setPowerDown(false);
|
| | | }
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|
| | | if(null != res) {
|
| | | try {
|
| | | res.close();
|
| | | } catch (SQLException e) {
|
| | | sql.logger.error("BTS61850_Task_Thread_SQL.queryPowerDataInf():" + e.toString(), e); |
| | | }
|
| | | }
|
| | | sql.close_con();
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 查询电源信息
|
| | | * @param pool
|
| | | * @param param
|
| | | */
|
| | | public static void queryPowerDataInf(MysqlConnPool pool, FBS9100_StatAndParam param) {
|
| | | String sql_str = "SELECT PowerDeviceId FROM " + Sql_Mysql.Pwrdev_Inf_Table + " WHERE StationId = " + param.StationId + " LIMIT 1";
|
| | | Sql_Mysql sql = new Sql_Mysql(pool);
|
| | | ResultSet res = null;
|
| | | try {
|
| | | res = sql.sqlMysqlQuery(sql_str);
|
| | | if(res.next()) {
|
| | | param.PowerDeviceId = res.getInt("PowerDeviceId");
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|
| | | if(null != res) {
|
| | | try {
|
| | | res.close();
|
| | | } catch (SQLException e) {
|
| | | sql.logger.error("BTS61850_Task_Thread_SQL.queryPowerDataInf():" + e.toString(), e); |
| | | }
|
| | | }
|
| | | sql.close_con();
|
| | | }
|
| | | }
|
| | | |
| | | public static void main(String[] args) {
|
| | | MysqlConnPool pool = new MysqlConnPool("192.168.10.79", 3360, 5);
|
| | | |
| | | FBS9100_StatAndParam param = new FBS9100_StatAndParam("127.0.0.1", 618500059);
|
| | | param.StationId = "42010149";
|
| | | |
| | | queryPowerDataInf(pool, param);
|
| | | queryPwrdev_Acdcdata_Table(pool, param);
|
| | | |
| | | |
| | | System.out.println("PowerDeviceId:" + param.PowerDeviceId + " : " + param.isPowerOff);
|
| | | }
|
| | | }
|
| | |
| | | private ServerModel m_ServerModel;
|
| | |
|
| | | private Logger logger = null;
|
| | |
|
| | | |
| | | private int bg_num = 1;
|
| | | /*********************************************************************************************/
|
| | | /*********************************************************************************************/
|
| | |
| | |
|
| | | //
|
| | | m_StatAndParam.keyID = AL_RTdata.getItem(n).ukeyID;
|
| | | |
| | | m_StatAndParam.StationId = AL_RTdata.getItem(n).StationId;
|
| | | //FBSDeviceIp = AL_RTdata.getItem(n).FBSDeviceIp;
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | if (m_BattMonCount > (FBS9100_ComBase.MonomerCountMax - 120)) {
|
| | | m_BattMonCount = (FBS9100_ComBase.MonomerCountMax - 120);
|
| | | }
|
| | |
| | |
|
| | | System.out.println("successfully read model");
|
| | | */
|
| | | |
| | | //获取当前设备的电源ID号
|
| | | BTS61850_Task_Thread_SQL.queryPowerDataInf(m_ConnPool,m_StatAndParam);
|
| | | /************************* read m_DevVersion first *************************/
|
| | | m_StatAndParam.m_DevVersion = readVersionStringNodeData(FBSDeviceName + "/ncdGGIO1.DevVersion.d", Fc.DC);
|
| | | /***************************************************************************/
|
| | |
| | |
|
| | | FBS9100_Task_Thread_SQL.inseartDev_6185_AlmParam(m_ConnPool, m_StatAndParam.dev_id);
|
| | |
|
| | | //m_StatAndParam.keyID = readStringNodeData(FBSDeviceName+"/btgGGIO1.ukeyID.d",Fc.DC);
|
| | | m_StatAndParam.keyID = readStringNodeData(FBSDeviceName+"/btgGGIO1.ukeyID.d",Fc.DC);
|
| | | m_StatAndParam.serialNumber = readStringNodeData(FBSDeviceName+"/btgGGIO1.Bts_ID.d",Fc.DC); //唯一序列号
|
| | | //BTS61850_Task_Thread_SQL.UpdateBattInfTable(m_ConnPool, m_StatAndParam); //更新当前参数
|
| | | BTS61850_Task_Thread_SQL.UpdateBattInfTable(m_ConnPool, m_StatAndParam); //更新当前参数
|
| | |
|
| | |
|
| | | //读取主从机功能使能
|
| | |
| | |
|
| | | if (m_StatAndParam != null) {
|
| | | // System.err.println(m_StatAndParam);
|
| | | BTS61850_Task_Thread_SQL.queryPwrdev_Acdcdata_Table(m_ConnPool, m_StatAndParam);
|
| | |
|
| | | FBS9100_Task_Thread_SQL.updateFbs9100StateByDev_Id(m_ConnPool, m_StatAndParam);
|
| | | FBS9100_Task_Thread_SQL.inseartOrUpdateFBS9100SFODState(m_ConnPool, m_StatAndParam,
|
| | | m_StatAndParam.fbs9100s_fod_state);
|
| | |
| | |
|
| | | FBS9100_Task_Thread_SQL.insertBTSEventRecordTable(m_ConnPool, events); // 记录历史事件和告警
|
| | |
|
| | | |
| | | |
| | | events.clear();
|
| | | }
|
| | | }
|
| | |
| | | public String publicKeyY;
|
| | | public String keyID = "";
|
| | | public String serialNumber = "";
|
| | |
|
| | | |
| | | public String StationId = "";
|
| | | public int PowerDeviceId = 0; //电源ID号
|
| | | public boolean isPowerOff = false; //电源交流失电标识 |
| | |
|
| | | public int CRC = 0;
|
| | |
|
| | |
| | | m_FBS_AlmParam = new FBS9100_AlarmParam();
|
| | | }
|
| | |
|
| | | public int getSysWorkState() {
|
| | | if(isPowerOff) {
|
| | | //交流失电时显示停电放电
|
| | | return FBS9100_SysState.IEC61850_SYS_STATE_PD_DISCHARGING;
|
| | | }else {
|
| | | return m_FBS_VCData.m_SysState.WorkState;
|
| | | }
|
| | | }
|
| | | |
| | | public void setPowerDown(boolean powerdown) {
|
| | | this.isPowerOff = powerdown;
|
| | | }
|
| | | |
| | | @Override
|
| | | public String toString() {
|
| | | return "FBS9100_StatAndParam [BYTE_LEN=" + BYTE_LEN + ", dev_id=" + dev_id + ", dev_ipaddr=" + dev_ipaddr
|
| | |
| | | public int RxNullErrCount = 0;
|
| | | public long Alm_RecId = 0;
|
| | | public String dev_version = "1.01";
|
| | | |
| | | //---------------------------------------//
|
| | | public int ResBattIndexMax; //��������������������������������������������������������
|
| | | public int ResBattIndex; //�����������������������������������������
|
| | |
| | | + v_data.m_SysState.DTime.second + "', "
|
| | | + "dev_testtype=" + v_data.m_SysState.TestType+ ", "
|
| | | + "dev_testgroupnum=" + v_data.m_SysState.TestGroupNum + ", "
|
| | | + "dev_workstate=" + v_data.m_SysState.WorkState + ", "
|
| | | + "dev_workstate=" + m_pm.getSysWorkState() + ", "
|
| | | // + "dev_workstate=" + v_data.m_SysState.WorkState + ", "
|
| | | + "dev_alarmstate=" + v_data.m_SysState.AlarmState + ", "
|
| | | + "dev_temp=" + v_data.m_SysState.temp + ", "
|
| | | + "dev_onlinevollow=" + v_data.m_SysState.OnlineVolLow + ", "
|
| | |
| | | |
| | | final public static String DB_DEV_TESTPARAM = "`db_dev_testparam`"; |
| | | final public static String DB_IED_SCOUT = "`db_ied_scout`"; |
| | | final public static String DB_PWRDEV_INF = "`db_pwrdev_inf`"; |
| | | final public static String DB_PWRDEV_DATA_RT = "`db_pwrdev_data_rt`"; |
| | | //--------------------------------------------------------------------------------------------// |
| | | public final static String TB_HardDevSmsState = "tb_hard_dev_sms_state"; |
| | | //--------------------------------------------------------------------------------------------// |
| | |
| | | /***************************** DB_IED_SCOUT 数据库 **********************************/ |
| | | public final static String Connect_Inf_Table = DB_IED_SCOUT + ".tb_connect_inf"; //IED连接信息表 |
| | | public final static String Ied_NodeState_Table = DB_IED_SCOUT + ".tb_ied_nodestate"; //设备信息表 |
| | | /***************************** db_pwrdev_inf 数据库 **********************************/ |
| | | |
| | | public final static String Pwrdev_Inf_Table = DB_PWRDEV_INF + ".tb_pwrdev_inf"; //设备信息表 |
| | | /***************************** db_pwrdev_data_rt 数据库 **********************************/ |
| | | public final static String Pwrdev_Acdcdata_Table = DB_PWRDEV_DATA_RT + ".tb_pwrdev_acdcdata"; //设备信息表 |
| | | |
| | | |
| | | //------------------------------------- -------------------------------------------------------// |
| | | |
| | | public Connection mysql_con; |
| | | public Logger logger = null; |
| | |
| | | /**************************************************************************/
|
| | | /**************************************************************************/
|
| | | public final static boolean app_debug = false;
|
| | | public final static double m_VersionNum = 6.109;
|
| | | public final static double m_VersionNum = 6.110;
|
| | | public final static String m_Version = "Welcome To Use BattMonitor_BTS_IEC61850 V"
|
| | | + m_VersionNum + " RC_20201003";
|
| | | /**************************************************************************/
|
| | |
| | |
|
| | | 注意当前版本在设置紫晶组2的61850协转签名时用的 BTSE/
|
| | |
|
| | |
|
| | | 重庆定制需求
|
| | |
|
| | | V6.110
|
| | | 1.当前设备的电源触发交流停电告警时,核容状态显示为停电放电 |
| | | |
| | | 充放电数据记录逻辑:
|
| | | (1)放电数据记录逻辑如下
|
| | | ① 其中电池触发放电数据记录逻辑为:
|