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 XdPtzMovedNotifyHolder extends AmqBasisEvent {
	private String fsmkmc;
	private List<XdPtzMovedNotifyPeas> list = new LinkedList<XdPtzMovedNotifyPeas>();
	public XdPtzMovedNotifyHolder() {
		msgType = AmqConst.AMQ_MSG_xdPtzMovedNotify;
		fsmkmc = "";
	}
	public String getFsmkmc() {
		return fsmkmc;
	}
	public void setFsmkmc(String fsmkmc) {
		this.fsmkmc = fsmkmc;
	}
	public List<XdPtzMovedNotifyPeas> getList() {
		return list;
	}
	public void setList(List<XdPtzMovedNotifyPeas> list) {
		this.list = list;
	}
	public void writeObjToXml() {
		super.writeObjToXml();
		Element fdListElement = outMsgTypeElement.addElement("liebiao");
		for (int i = 0; i < list.size(); i++) {
			XdPtzMovedNotifyPeas 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, "tdbh", info.getTdbh());//[通道编号]
// 			this.addTextToElement(element, "yzdbh", info.getYzdbh());//[预置点位编号]
 			this.addTextToElement(element, "zt", info.getZt());//[状态；1：移位， 0：恢复]
 		}
	}
	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++) {
 			XdPtzMovedNotifyPeas info = new XdPtzMovedNotifyPeas();
 			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.setTdbh(this.readIntFromElement(element, "tdbh"));//[通道编号]
// 			info.setYzdbh(this.readIntFromElement(element, "yzdbh"));//[通道编号]
 			info.setZt(this.readIntFromElement(element, "zt"));//[状态；1：移位， 0：恢复]
 			list.add(info);
 		}
	}
}
