| | |
| | | m_FBS_VCData.m_SysState.setCommCountInc();
|
| | | return res_val;
|
| | | }
|
| | | |
| | | private float readInt64NodeData(String reference, Fc fc) {
|
| | | float res_val = 0;
|
| | | |
| | | FcModelNode fcModelNode = (FcModelNode)m_ServerModel.findModelNode(reference, fc);
|
| | | if(null == fcModelNode) {
|
| | | //System.err.println("error readNodeData(), no modenode was found.....");
|
| | | return 0;
|
| | | } |
| | | try {
|
| | | m_Association.getDataValues(fcModelNode);
|
| | | BasicDataBind<?> data = new Int64DataBind((BdaInt64)fcModelNode);
|
| | | JTextField tf_t = (JTextField)data.getValueField();
|
| | | res_val = Float.parseFloat(tf_t.getText());
|
| | | |
| | | } catch (ServiceError | IOException e) {
|
| | | System.out.println("Fatal error: " + e.getMessage());
|
| | | }
|
| | | m_FBS_VCData.m_SysState.setCommCountInc();
|
| | | return res_val;
|
| | | }
|
| | | |
| | | /*********************************************************************************************/
|
| | | private float JUDGEreadFloatNodeData(String reference, Fc fc) {
|
| | | float res_val = 0;
|
| | |
| | | events.clear();
|
| | |
|
| | | DataSet ds = null;
|
| | | if(m_FBS_VCData.m_SysState.WorkState==2) {
|
| | | if(m_FBS_VCData.m_SysState.WorkState == 99) {
|
| | | ds = m_ServerModel.getDataSet(FBSDeviceName+"/LLN0.dsDevState");
|
| | | int size_cnt = ds.getMembers().size();
|
| | | m_Association.getDataSetValues(ds);
|
| | |
| | | } else if (FBS9100_ComBase.CMD_Stop == cmd) {
|
| | |
|
| | | comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName+"/ncdGGIO1.SPCSO1.Oper", false);
|
| | | comm_res = checkMakeSuccess();
|
| | | int count = 1;
|
| | | if(m_FBS_VCData.m_SysState.WorkState == 2 || m_FBS_VCData.m_SysState.WorkState == 3) {
|
| | | count = 6;
|
| | | }else if(m_FBS_VCData.m_SysState.WorkState == 1){
|
| | | count = 7;
|
| | | }else if(m_FBS_VCData.m_SysState.WorkState == 5) {
|
| | | count = 8;
|
| | | }
|
| | | comm_res = checkMakeSuccess(count);
|
| | |
|
| | | } else if (FBS9100_ComBase.CMD_StartDischarge == cmd) {
|
| | |
|
| | | comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName+"/ncdGGIO1.SPCSO1.Oper", true);
|
| | | //battStatData.setBattFloatCurrLevel(-1);
|
| | | //battStatData.updateCurrFrom_FBSDev(0);
|
| | | comm_res = checkMakeSuccess();
|
| | | comm_res = checkMakeSuccess(0);
|
| | | } else if (FBS9100_ComBase.CMD_StartResDischarge == cmd) {
|
| | | comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName+"/ncdGGIO1.SPCSO2.Oper", true);
|
| | | comm_res = checkMakeSuccess();
|
| | | comm_res = checkMakeSuccess(2);
|
| | | } else if (FBS9100_ComBase.CMD_StartKIDI == cmd) {
|
| | | comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName+"/ncdGGIO1.SPCSO3.Oper", true);
|
| | | comm_res = checkMakeSuccess();
|
| | | comm_res = checkMakeSuccess(1);
|
| | | } else if (FBS9100_ComBase.CMD_SetIp == cmd) {
|
| | | setip();
|
| | | DecimalFormat df=new DecimalFormat("000");
|
| | |
| | | comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName+"/ncdGGIO1.SPCSO8.Oper", true); //模块41除硫
|
| | | break;
|
| | | }
|
| | | comm_res = checkMakeSuccess();
|
| | | comm_res = checkMakeSuccess(3);
|
| | |
|
| | | }else if(FBS9100_ComBase.CMD_Stop_FOD_test == cmd) {
|
| | | //System.out.println(m_StatAndParam.clParam.GroupNum);
|
| | |
| | | comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName+"/ncdGGIO1.SPCSO12.Oper", false);
|
| | | break;
|
| | | }
|
| | | comm_res = checkMakeSuccess();
|
| | | comm_res = checkMakeSuccess(9);
|
| | | }else if(FBS9100_ComBase.CMD_Start_FODYH_test == cmd) {
|
| | | switch(m_StatAndParam.clParam.GroupNum) {
|
| | | case 1:
|
| | |
| | | comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName+"/ncdGGIO1.SPCSO12.Oper", true);
|
| | | break;
|
| | | }
|
| | | comm_res = checkMakeSuccess();
|
| | | comm_res = checkMakeSuccess(4);
|
| | | }else if(FBS9100_ComBase.CMD_GetOffLineYHParam == cmd) {
|
| | | //System.err.println("读取离线养护参数");
|
| | | //读取离线养护参数
|
| | |
| | | //启动离线养护
|
| | | //System.err.println("启动离线养护");
|
| | | comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName+"/ncdGGIO1.SPCSO13.Oper", true);
|
| | | comm_res = checkMakeSuccess();
|
| | | comm_res = checkMakeSuccess(5);
|
| | | }else if(FBS9100_ComBase.CMD_StopOffLineYH == cmd) {
|
| | | //System.err.println("停止离线养护");
|
| | | //停止离线养护
|
| | | comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName+"/ncdGGIO1.SPCSO13.Oper", false);
|
| | | comm_res = checkMakeSuccess();
|
| | | comm_res = checkMakeSuccess(10);
|
| | | }else if(FBS9100_ComBase.CMD_ResetSystem == cmd) {
|
| | | //System.err.println("重启系统");
|
| | | comm_res = BTS_IEC61850_Write_CO_Node(FBSDeviceName+"/ncdGGIO1.SPCSO14.Oper", true);
|
| | |
| | | return comm_res;
|
| | | }
|
| | |
|
| | | public boolean checkMakeSuccess() {
|
| | | public boolean checkMakeSuccess(int count) {
|
| | | boolean success = false;
|
| | | for(int i = 0;i<100;i++) {
|
| | | int flag = (int)(readFloatNodeData(FBSDeviceName+"/ncdGGIO1.AnIn119.mag.f", Fc.MX));
|
| | | if(flag == 1) {
|
| | | success = true;
|
| | | break;
|
| | | try {
|
| | | Thread.sleep(4000);
|
| | | } catch (InterruptedException e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | int okcount = 0;
|
| | | for(int i = 0;i<20;i++) {
|
| | | int value = (int)(readInt64NodeData(FBSDeviceName+"/ncdGGIO1.AnIn119.mag.i", Fc.MX));
|
| | | //System.out.println("操作结果:" + value+"==="+MyUtil.power(2, count));
|
| | | if((value & MyUtil.power(2, count)) == MyUtil.power(2, count)) {
|
| | | okcount ++;
|
| | | if(okcount >= 10) {
|
| | | //System.out.println("校验成功===="+i);
|
| | | success = true;
|
| | | break;
|
| | | }
|
| | | } else {
|
| | | okcount = 0;
|
| | | }
|
| | | try {
|
| | | sleep(50);
|
| | | sleep(100);
|
| | | } catch (InterruptedException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | | }
|
| | | return success;
|
| | | }
|