package com.dec.fbs9100; import java.util.Date; public class FBS9100_SysState { public static final byte SYS_STATE_STOPPED = 0; public static final byte SYS_STATE_DISCHARGING = 1; public static final byte SYS_STATE_CHARGING = 2; //--------------------------------------------------------// public static final byte IEC61850_SYS_STATE_STOPPED = 0; public static final byte IEC61850_SYS_STATE_CHARGING = 1; public static final byte IEC61850_SYS_STATE_DISCHARGING = 2; public static final byte IEC61850_SYS_STATE_PD_DISCHARGING = 3; public static final byte IEC61850_SYS_STATE_RES_TEST = 4; public static final byte IEC61850_SYS_STATE_KD_TEST = 5; //--------------------------------------------------------// private final int BYTE_LEN = 14; //--------------------------------------------------------// public Date Record_DateTime = new Date(); //--------------------------------------------------------// public FBS9100_DateTime DTime = new FBS9100_DateTime(); //���������������������������� public int TestType = 0; //������������������������(�����������������) public int TestGroupNum = 1; //������������������������������������������1-4 public int WorkState = SYS_STATE_STOPPED; //�������������������� public int AlarmState = 0; //�������������� public float temp = 0; public int OnlineVolLow = 0; //������������������������(��������������) public int CapTestStopType = -1; //�������������������� public int eachgroup_battsum = 0; public int restest_moncount = 0; public int restest_monindex = 0; public float resttest_count = 0; public String last_dev_61850alam = "false,false,false,false"; //上一次告警状态 public String dev_61850alam = "false,false,false,false"; //4种告警对应状态【K告警,通讯告警,设备高温告警,D告警,设备干接点故障】 public float conresist = 0; public float concurr = 0; public float condvoldp = 0; public float condcurr = 0; public int MasterSlave_en = 0; //主从机使能 public int DryContact_en = 0; //干接点使能 //public int captest_stop_type = -1; public int CommCount = 0; //���������������� public int ErrCommCount = 0; public int RxNullErrCount = 0; public long Alm_RecId = 0; public String dev_version = "1.01"; //---------------------------------------// public int ResBattIndexMax; //�������������������������������������������������������� public int ResBattIndex; //����������������������������������������� //---------------------------------------// public int CRC = 0; public FBS9100_SysState clone() { FBS9100_SysState obj = new FBS9100_SysState(); obj.DTime = DTime.clone(); obj.TestType = TestType; obj.TestGroupNum = TestGroupNum; obj.dev_61850alam = dev_61850alam; obj.WorkState = WorkState; obj.eachgroup_battsum = eachgroup_battsum; obj.restest_moncount = restest_moncount; obj.restest_monindex = restest_monindex; obj.resttest_count = resttest_count; obj.AlarmState = AlarmState; obj.temp = temp; obj.OnlineVolLow = OnlineVolLow; obj.CapTestStopType = CapTestStopType; obj.conresist = conresist; obj.concurr = concurr; obj.condvoldp = condvoldp; obj.condcurr = condcurr; obj.CommCount = CommCount; obj.ErrCommCount = ErrCommCount; obj.RxNullErrCount = RxNullErrCount; obj.CRC = CRC; return obj; } public void setCommCountInc() { Record_DateTime = new Date(); CommCount += 1; //System.out.println("CommCount:"+CommCount); if(CommCount >= 90000000) { CommCount = 1; } } public void addErrCommCount() { if(ErrCommCount < 9000000) { ErrCommCount += 1; }else { ErrCommCount = 20; } } public void setErrCommCountInc(int rx_len) { if(ErrCommCount < 10000) { ErrCommCount += 1; } if(rx_len < 1) { RxNullErrCount += 1; } if(RxNullErrCount >= 90000000) { RxNullErrCount = 20; } } public void resetErrCommCount() { ErrCommCount = 0; } public void setDateTime(FBS9100_DateTime dt) { DTime = dt; } @Override public String toString() { return "FBS9100_SysState [BYTE_LEN=" + BYTE_LEN + ", DTime=" + DTime + ", TestType=" + TestType + ", TestGroupNum=" + TestGroupNum + ", WorkState=" + WorkState + ", AlarmState=" + AlarmState + ", OnlineVolLow=" + OnlineVolLow + ", CommCount=" + CommCount + ", ErrCommCount=" + ErrCommCount + ", Alm_RecId=" + Alm_RecId + ", ResBattIndexMax=" + ResBattIndexMax + ", ResBattIndex=" + ResBattIndex + ", CRC=" + CRC + "]"; } } /*************************************************************************************** ****************************** end of file (FBS_SysState) ****************************** ***************************************************************************************/