| | |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.modbus.data.MyModbusMaster; |
| | | import com.modbus.data.MyModbusUtils; |
| | |
| | | public Date alarm_confirmtime; |
| | | public String note; |
| | | |
| | | public int synchro_cycle_fault; |
| | | public int main_cabinet_fault_one; |
| | | public int main_cabinet_fault_two; |
| | | public int dcover_curr; |
| | | public int synchro_lose; |
| | | public int dcover_vol; |
| | | public int case_pulse_block; |
| | | public int case_transA_overcurr; |
| | | public int case_transB_overcurr; |
| | | public int case_transC_overcurr; |
| | | public int case_cuurfeedback_lose; |
| | | public int case_trip; |
| | | public int high_vol_switch_off; |
| | | public int emergency_button_pressed; |
| | | public int cabinet_door_protection; |
| | | public int tran_overtmp; |
| | | public int tran_overhightmp_trip; |
| | | public int synchro_cycle_fault; //机箱同步周期故障 |
| | | public int main_cabinet_fault_one; //机箱1号主柜快熔断 |
| | | public int main_cabinet_fault_two; //机箱2号主柜快熔断 |
| | | public int dcover_curr; //机箱直流过流 |
| | | public int synchro_lose; //机箱同步丢失 |
| | | public int dcover_vol; //机箱直流过压 |
| | | public int case_pulse_block; //机箱脉冲封锁 |
| | | public int case_transA_overcurr; //机箱A相过流 |
| | | public int case_transB_overcurr; //机箱B相过流 |
| | | public int case_transC_overcurr; //机箱C相过流 |
| | | public int case_cuurfeedback_lose; //机箱直流反馈丢失 |
| | | public int case_trip; //机箱跳闸 |
| | | public int high_vol_switch_off; //高压开关断开 |
| | | public int emergency_button_pressed; //紧急按钮按下 |
| | | public int cabinet_door_protection; //变压器柜门保护 |
| | | public int tran_overtmp; //变压器超温 |
| | | public int tran_overhightmp_trip; //变压器超高温跳闸 |
| | | |
| | | public boolean isReadOk = false; |
| | | |
| | | public Electric_2MW_alarm(int electric_id) { |
| | | super(); |
| | | this.electric_id=electric_id; |
| | | } |
| | | |
| | | public Electric_2MW_alarm clone() { |
| | | Electric_2MW_alarm alarm = new Electric_2MW_alarm(this.electric_id); |
| | | alarm.synchro_cycle_fault = this.synchro_cycle_fault; //机箱同步周期故障 |
| | | alarm.main_cabinet_fault_one = this.main_cabinet_fault_one; //机箱1号主柜快熔断 |
| | | alarm.main_cabinet_fault_two = this.main_cabinet_fault_two; //机箱2号主柜快熔断 |
| | | alarm.dcover_curr = this.dcover_curr; //机箱直流过流 |
| | | alarm.synchro_lose = this.synchro_lose; //机箱同步丢失 |
| | | alarm.dcover_vol = this.dcover_vol; //机箱直流过压 |
| | | alarm.case_pulse_block = this.case_pulse_block; //机箱脉冲封锁 |
| | | alarm.case_transA_overcurr = this.case_transA_overcurr; //机箱A相过流 |
| | | alarm.case_transB_overcurr = this.case_transB_overcurr; //机箱B相过流 |
| | | alarm.case_transC_overcurr = this.case_transC_overcurr; //机箱C相过流 |
| | | alarm.case_cuurfeedback_lose = this.case_cuurfeedback_lose; //机箱直流反馈丢失 |
| | | alarm.case_trip = this.case_trip; //机箱跳闸 |
| | | alarm.high_vol_switch_off = this.high_vol_switch_off; //高压开关断开 |
| | | alarm.emergency_button_pressed = this.emergency_button_pressed; //紧急按钮按下 |
| | | alarm.cabinet_door_protection = this.cabinet_door_protection; //变压器柜门保护 |
| | | alarm.tran_overtmp = this.tran_overtmp; //变压器超温 |
| | | alarm.tran_overhightmp_trip = this.tran_overhightmp_trip; //变压器超高温跳闸 |
| | | return alarm; |
| | | } |
| | | |
| | | /** |
| | | * 根据设备id获取当前 |
| | | * @param alarm_id |
| | | * @return |
| | | */ |
| | | public String getStrByAlarm_id(int alarm_id) { |
| | | switch(alarm_id) { |
| | | case 109001:return "synchro_cycle_fault"; |
| | | case 109002:return "main_cabinet_fault_one"; |
| | | case 109003:return "main_cabinet_fault_two"; |
| | | case 109004:return "dcover_curr"; |
| | | case 109005:return "synchro_lose"; |
| | | case 109006:return "dcover_vol"; |
| | | case 109007:return "case_pulse_block"; |
| | | case 109008:return "case_transA_overcurr"; |
| | | case 109009:return "case_transB_overcurr"; |
| | | case 109010:return "case_transC_overcurr"; |
| | | case 109011:return "case_cuurfeedback_lose"; |
| | | case 109012:return "case_trip"; |
| | | case 109013:return "high_vol_switch_off"; |
| | | case 109014:return "emergency_button_pressed"; |
| | | case 109015:return "cabinet_door_protection"; |
| | | case 109016:return "tran_overtmp"; |
| | | case 109017:return "tran_overhightmp_trip"; |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * 根据告警id设置告警状态 |
| | | * @param alarm_id |
| | | */ |
| | | public void setAlarmStateByAlarm_id(int alarm_id) { |
| | | switch(alarm_id) { |
| | | case 109001:this.synchro_cycle_fault = 1; |
| | | case 109002:this.main_cabinet_fault_one = 1; |
| | | case 109003:this.main_cabinet_fault_two = 1; |
| | | case 109004:this.dcover_curr = 1; |
| | | case 109005:this.synchro_lose = 1; |
| | | case 109006:this.dcover_vol = 1; |
| | | case 109007:this.case_pulse_block = 1; |
| | | case 109008:this.case_transA_overcurr = 1; |
| | | case 109009:this.case_transB_overcurr = 1; |
| | | case 109010:this.case_transC_overcurr = 1; |
| | | case 109011:this.case_cuurfeedback_lose = 1; |
| | | case 109012:this.case_trip = 1; |
| | | case 109013:this.high_vol_switch_off = 1; |
| | | case 109014:this.emergency_button_pressed = 1; |
| | | case 109015:this.cabinet_door_protection = 1; |
| | | case 109016:this.tran_overtmp = 1; |
| | | case 109017:this.tran_overhightmp_trip = 1; |
| | | } |
| | | } |
| | | |
| | | public int getAlarmIdByStr(String str) { |
| | | switch(str) { |
| | | case "synchro_cycle_fault":return 109001; |
| | | case "main_cabinet_fault_one":return 109002; |
| | | case "main_cabinet_fault_two":return 109003; |
| | | case "dcover_curr":return 109004; |
| | | case "synchro_lose":return 109005; |
| | | case "dcover_vol":return 109006; |
| | | case "case_pulse_block":return 109007; |
| | | case "case_transA_overcurr":return 109008; |
| | | case "case_transB_overcurr":return 109009; |
| | | case "case_transC_overcurr":return 109010; |
| | | case "case_cuurfeedback_lose":return 109011; |
| | | case "case_trip":return 109012; |
| | | case "high_vol_switch_off":return 109013; |
| | | case "emergency_button_pressed":return 109014; |
| | | case "cabinet_door_protection":return 109015; |
| | | case "tran_overtmp":return 109016; |
| | | case "tran_overhightmp_trip":return 109017; |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | public int getNum() { |
| | | return num; |
| | | } |
| | |
| | | + alarm_endtime + ", alarm_confirm=" + alarm_confirm + ", alarm_confirmtime=" + alarm_confirmtime |
| | | + ", note=" + note + "]"; |
| | | } |
| | | |
| | | |
| | | |
| | | //读取2MW故障信息 |
| | | public BatchRead<Integer> createBatchRead(MyModbusMaster master) { |
| | | BatchRead<Integer> batch = new BatchRead<Integer>(); |
| | |
| | | this.tran_overhightmp_trip=MyModbusUtils.readBooleanToInt(res.getValue(16)); |
| | | } |
| | | } |
| | | |
| | | public void checkAlarm(Electric_2MW_alarm last_alarms, List<DeviceAlarm> addalarm, |
| | | List<DeviceAlarm> delalarm) { |
| | | |
| | | if(this.synchro_cycle_fault > last_alarms.synchro_cycle_fault) { |
| | | //出现新的告警记录 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("synchro_cycle_fault")); |
| | | addalarm.add(alarm); |
| | | }else if(this.synchro_cycle_fault < last_alarms.synchro_cycle_fault) { |
| | | //告警消失 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("synchro_cycle_fault")); |
| | | delalarm.add(alarm); |
| | | } |
| | | |
| | | if(this.main_cabinet_fault_one > last_alarms.main_cabinet_fault_one) { |
| | | //出现新的告警记录 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("main_cabinet_fault_one")); |
| | | addalarm.add(alarm); |
| | | }else if(this.main_cabinet_fault_one < last_alarms.main_cabinet_fault_one){ |
| | | //告警消失 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("main_cabinet_fault_one")); |
| | | delalarm.add(alarm); |
| | | } |
| | | |
| | | |
| | | if(this.main_cabinet_fault_two > last_alarms.main_cabinet_fault_two) { |
| | | //出现新的告警记录 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("main_cabinet_fault_two")); |
| | | addalarm.add(alarm); |
| | | }else if(this.main_cabinet_fault_two < last_alarms.main_cabinet_fault_two){ |
| | | //告警消失 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("main_cabinet_fault_two")); |
| | | delalarm.add(alarm); |
| | | } |
| | | |
| | | if(this.dcover_curr > last_alarms.dcover_curr) { |
| | | //出现新的告警记录 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("dcover_curr")); |
| | | addalarm.add(alarm); |
| | | }else if(this.dcover_curr < last_alarms.dcover_curr){ |
| | | //告警消失 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("dcover_curr")); |
| | | delalarm.add(alarm); |
| | | } |
| | | |
| | | if(this.synchro_lose > last_alarms.synchro_lose) { |
| | | //出现新的告警记录 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("synchro_lose")); |
| | | addalarm.add(alarm); |
| | | }else if(this.synchro_lose < last_alarms.synchro_lose){ |
| | | //告警消失 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("synchro_lose")); |
| | | delalarm.add(alarm); |
| | | } |
| | | |
| | | if(this.dcover_vol > last_alarms.dcover_vol) { |
| | | //出现新的告警记录 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("dcover_vol")); |
| | | addalarm.add(alarm); |
| | | }else if(this.dcover_vol < last_alarms.dcover_vol){ |
| | | //告警消失 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("dcover_vol")); |
| | | delalarm.add(alarm); |
| | | } |
| | | |
| | | if(this.case_pulse_block > last_alarms.case_pulse_block) { |
| | | //出现新的告警记录 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("case_pulse_block")); |
| | | addalarm.add(alarm); |
| | | }else if(this.case_pulse_block < last_alarms.case_pulse_block){ |
| | | //告警消失 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("case_pulse_block")); |
| | | delalarm.add(alarm); |
| | | } |
| | | |
| | | if(this.case_transA_overcurr > last_alarms.case_transA_overcurr) { |
| | | //出现新的告警记录 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("case_transA_overcurr")); |
| | | addalarm.add(alarm); |
| | | }else if(this.case_transA_overcurr < last_alarms.case_transA_overcurr){ |
| | | //告警消失 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("case_transA_overcurr")); |
| | | delalarm.add(alarm); |
| | | } |
| | | |
| | | if(this.case_transB_overcurr > last_alarms.case_transB_overcurr) { |
| | | //出现新的告警记录 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("case_transB_overcurr")); |
| | | addalarm.add(alarm); |
| | | }else if(this.case_transB_overcurr < last_alarms.case_transB_overcurr){ |
| | | //告警消失 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("case_transB_overcurr")); |
| | | delalarm.add(alarm); |
| | | } |
| | | if(this.case_transC_overcurr > last_alarms.case_transC_overcurr) { |
| | | //出现新的告警记录 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("case_transC_overcurr")); |
| | | addalarm.add(alarm); |
| | | }else if(this.case_transC_overcurr < last_alarms.case_transC_overcurr){ |
| | | //告警消失 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("case_transC_overcurr")); |
| | | delalarm.add(alarm); |
| | | } |
| | | |
| | | if(this.case_cuurfeedback_lose > last_alarms.case_cuurfeedback_lose) { |
| | | //出现新的告警记录 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("case_cuurfeedback_lose")); |
| | | addalarm.add(alarm); |
| | | }else if(this.case_cuurfeedback_lose < last_alarms.case_cuurfeedback_lose){ |
| | | //告警消失 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("case_cuurfeedback_lose")); |
| | | delalarm.add(alarm); |
| | | } |
| | | |
| | | if(this.case_trip > last_alarms.case_trip) { |
| | | //出现新的告警记录 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("case_trip")); |
| | | addalarm.add(alarm); |
| | | }else if(this.case_trip < last_alarms.case_trip){ |
| | | //告警消失 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("case_trip")); |
| | | delalarm.add(alarm); |
| | | } |
| | | |
| | | if(this.high_vol_switch_off > last_alarms.high_vol_switch_off) { |
| | | //出现新的告警记录 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("high_vol_switch_off")); |
| | | addalarm.add(alarm); |
| | | }else if(this.high_vol_switch_off < last_alarms.high_vol_switch_off){ |
| | | //告警消失 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("high_vol_switch_off")); |
| | | delalarm.add(alarm); |
| | | } |
| | | |
| | | if(this.emergency_button_pressed > last_alarms.emergency_button_pressed) { |
| | | //出现新的告警记录 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("emergency_button_pressed")); |
| | | addalarm.add(alarm); |
| | | }else if(this.emergency_button_pressed < last_alarms.emergency_button_pressed){ |
| | | //告警消失 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("emergency_button_pressed")); |
| | | delalarm.add(alarm); |
| | | } |
| | | |
| | | if(this.cabinet_door_protection > last_alarms.cabinet_door_protection) { |
| | | //出现新的告警记录 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("cabinet_door_protection")); |
| | | addalarm.add(alarm); |
| | | }else if(this.cabinet_door_protection < last_alarms.cabinet_door_protection){ |
| | | //告警消失 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("cabinet_door_protection")); |
| | | delalarm.add(alarm); |
| | | } |
| | | |
| | | if(this.tran_overtmp > last_alarms.tran_overtmp) { |
| | | //出现新的告警记录 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("tran_overtmp")); |
| | | addalarm.add(alarm); |
| | | }else if(this.tran_overtmp < last_alarms.tran_overtmp){ |
| | | //告警消失 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("tran_overtmp")); |
| | | delalarm.add(alarm); |
| | | } |
| | | |
| | | if(this.tran_overhightmp_trip > last_alarms.tran_overhightmp_trip) { |
| | | //出现新的告警记录 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("tran_overhightmp_trip")); |
| | | addalarm.add(alarm); |
| | | }else if(this.tran_overhightmp_trip < last_alarms.tran_overhightmp_trip){ |
| | | //告警消失 |
| | | DeviceAlarm alarm = new DeviceAlarm(this.electric_id, getAlarmIdByStr("tran_overhightmp_trip")); |
| | | delalarm.add(alarm); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |