package cn.amq.peas;

import java.util.LinkedList;
import java.util.List;
import org.dom4j.Element;
import org.dom4j.Node;
import cn.amq.basis.AmqBasisEvent;
import cn.amq.basis.AmqConst;
import java.util.LinkedList;
//[交通事件告警_holder]
public class TrafficEventAlarmHolder extends AmqBasisEvent {
	private String fsmkmc;
	private List<TrafficEventAlarmPeas> list = new LinkedList<TrafficEventAlarmPeas>();
	public TrafficEventAlarmHolder() {
		msgType = AmqConst.AMQ_MSG_trafficEventAlarm;
		fsmkmc = "";
	}
	public String getFsmkmc() {
		return fsmkmc;
	}
	public void setFsmkmc(String fsmkmc) {
		this.fsmkmc = fsmkmc;
	}
	public List<TrafficEventAlarmPeas> getList() {
		return list;
	}
	public void setList(List<TrafficEventAlarmPeas> list) {
		this.list = list;
	}
	public void writeObjToXml() {
		super.writeObjToXml();
		Element fdListElement = outMsgTypeElement.addElement("liebiao");
		for (int i = 0; i < list.size(); i++) {
			TrafficEventAlarmPeas info = list.get(i);
			Element element = fdListElement.addElement("jiedian");
 			this.addTextToElement(element, "gjxh", info.getGjxh());//[告警序号]
 			this.addTextToElement(element, "gjbh", info.getGjbh());//[告警编号]
 			this.addTextToElement(element, "gjsj", info.getGjsj());//[告警时间]
 			this.addTextToElement(element, "sbbh", info.getSbbh());//[设备编号]
 			this.addTextToElement(element, "sbmc", info.getSbmc());//[设备名称]
 			this.addTextToElement(element, "tdbh", info.getTdbh());//[通道编号]
 			this.addTextToElement(element, "tdlx", info.getTdlx());//[通道类型]
 			this.addTextToElement(element, "tddlx", info.getTddlx());//[通道大类型]
 			this.addTextToElement(element, "sjlx", info.getSjlx());//[事件类型]
 			this.addTextToElement(element, "sjdj", info.getSjdj());//[事件等级]
 			this.addTextToElement(element, "jcfx", info.getJcfx());//[检测方向]
 			this.addTextToElement(element, "mblx", info.getMblx());//[目标类型]
 			this.addTextToElement(element, "mbwzbd", info.getMbwzbd());//[目标左上和右下坐标]
 			this.addTextToElement(element, "ruleNum", info.getRuleNum());//[报警规则号]
 			this.addTextToElement(element, "tpurllj", info.getTpurllj());//[图片url路径]
 			this.addTextToElement(element, "spurllj", info.getSpurllj());//[视频url路径]
 			this.addTextToElement(element, "cfbz", info.getCfbz());//[触发标志]
 			this.addTextToElement(element, "zt", info.getZt());//[状态]
 			this.addTextToElement(element, "bz", info.getBz());//[备注]
 			this.addTextToElement(element, "jd", info.getJd());//[经度]
 			this.addTextToElement(element, "wd", info.getWd());//[纬度]
 		}
	}
	public void readTextToObject(String text) throws Exception {
		super.readTextToObject(text);
		Node node = this.inDocument.selectSingleNode("/amq/fsmkmc");
		fsmkmc = this.readStringByFullPath("/amq/fsmkmc");
		List nodeList = this.inDocument.selectNodes("/amq/liebiao/jiedian");
		for (int i = 0; i < nodeList.size(); i++) {
 			TrafficEventAlarmPeas info = new TrafficEventAlarmPeas();
 			Element element = (Element) nodeList.get(i);
 			info.setGjxh(this.readStringFromElement(element, "gjxh"));//[告警序号]
 			info.setGjbh(this.readIntFromElement(element, "gjbh"));//[告警编号]
 			info.setGjsj(this.readStringFromElement(element, "gjsj"));//[告警时间]
 			info.setSbbh(this.readStringFromElement(element, "sbbh"));//[设备编号]
 			info.setSbmc(this.readStringFromElement(element, "sbmc"));//[设备名称]
 			info.setTdbh(this.readIntFromElement(element, "tdbh"));//[通道编号]
 			info.setTdlx(this.readIntFromElement(element, "tdlx"));//[通道类型]
 			info.setTddlx(this.readIntFromElement(element, "tddlx"));//[通道大类型]
 			info.setSjlx(this.readStringFromElement(element, "sjlx"));//[事件类型]
 			info.setSjdj(this.readStringFromElement(element, "sjdj"));//[事件等级]
 			info.setJcfx(this.readStringFromElement(element, "jcfx"));//[检测方向]
 			info.setMblx(this.readStringFromElement(element, "mblx"));//[目标类型]
 			info.setMbwzbd(this.readStringFromElement(element, "mbwzbd"));//[目标左上和右下坐标]
 			info.setRuleNum(this.readStringFromElement(element, "ruleNum"));//[报警规则号]
 			info.setTpurllj(this.readStringFromElement(element, "tpurllj"));//[图片url路径]
 			info.setSpurllj(this.readStringFromElement(element, "spurllj"));//[视频url路径]
 			info.setCfbz(this.readStringFromElement(element, "cfbz"));//[触发标志]
 			info.setZt(this.readStringFromElement(element, "zt"));//[状态]
 			info.setBz(this.readStringFromElement(element, "bz"));//[备注]
 			info.setJd(this.readStringFromElement(element, "jd"));//[经度]
 			info.setWd(this.readStringFromElement(element, "wd"));//[纬度]
 			list.add(info);
 		}
	}
}
