//开始
public longstart()
{
InitSecs();
InitWhenever();
MapManage.SetSecsEquipObject(m_nKey,this);return m_pImpl.Start(m_pMDLN, "");
}//停止
public voidAbort()
{
m_pImpl.Abort();
MapManage.DeleteSecsEquipObject(m_nKey);
}//警告处理
public void AlarmAdd(int ALID, stringALTX)
{
AlarmAdd(ALID, ALTX, ALID, ALID+1);
}//Extended version of AlarmAdd used when you need to customize the event report//CEID's used for the Alarm Set and Alarm Clear events//警告与CEID不能相同//ALID:Alaram ID//ALTX:描述//alarmSetCEID: 设置ID//alarmClearCEID: 清除ID
public void AlarmAdd(int ALID, string ALTX, int alarmSetCEID, intalarmClearCEID)
{//eq_alarm_add, ALID, ALTX, SetCEID, ClearCEID
if ( ALTX.Length > 120)
{throw new Exception("ALTX should be <=120 ASCII characters");
}string cmd = "eq_alarm_add";
CListOperate.listAppend(refcmd, ALID.ToString(), ALTX,
alarmSetCEID.ToString(), alarmClearCEID.ToString());
m_pImpl.toolCmd(cmd);
}//报警使能
public void AlarmEnable(int ALID, boolbEnabled)
{//eq_alarm_enable, ALID, Enable
string cmd = "eq_alarm_enable";
CListOperate.listAppend(ref cmd, ALID.ToString(), bEnabled?"1":"0");
m_pImpl.toolCmd(cmd);
}//报警设置
public void AlarmSet(int ALID, boolbSet)
{//eq_alarm_set, ALID, set
string cmd = "eq_alarm_set";
CListOperate.listAppend(ref cmd, ALID.ToString(), bSet ? "1" : "0");
m_pImpl.toolCmd(cmd);
}//报警获取列表
public ListAlarmGetList()
{//eq_alarm_get_list//ALID, ALTX, Enable, Set
string cmd = "eq_alarm_get_list";
RcResult reply;
reply=m_pImpl.toolCmdReply(cmd);//解析
List listInfo = new List();if (reply.rc == 0 && reply.result != null)
{string[] listAlarm = null;string[] element = null;
CListOperate.listSplit(reply.result,reflistAlarm);for (int i = 0; i < listAlarm.Length; i++)
{
CListOperate.listSplit(listAlarm[i],refelement);if (element != null && element.Length > 3)
{
AlarmInfo info= newAlarmInfo();
info.ALID= element[0];
info.ALTX= element[1];
info.bEnable= element[2]=="1"?true:false;
info.bSet= element[3] == "1" ? true : false;
listInfo.Add(info);
}
}
}returnlistInfo;
}public void SendSingleTerminal(stringcontent)
{string type = "B 0";string msg = "L";string info = "A";
CListOperate.listAppend(refinfo, content);
CListOperate.listAppend(refmsg, type, info);string Reply = "";
m_pImpl.SendMsg(msg,refReply);
}