123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Diagnostics;
- using System.Data;
- namespace FPER
- {
-
- public class CmdInfo
- {
- private prt_cmd_define cmd_define;
- private prt_res_define res_define;
- private int ReceiverID = 0;
- private int commId = 1;
- private int LoopNo = 0;
- private int BoardNo = 0;
- private int RepeaterNo = 0;
-
- private int InvorkNo = 0;
- private object commandData = null;
- private string devicetype = "C";
- private int deviceId = 0;
-
- private string commandType = null;
- private string subType = "*";
- private string applyRange = "A";
- private int status = 0;
-
- private byte analogDetecterFault = 0x00;
- private byte analogDetecterPreFire = 0x00;
- private byte analogDetecterFireNight = 0x00;
- private byte analogDetecterFireDay = 0x00;
-
- private Boolean response = false;
- private Boolean errResponse = false;
- private object responseData = null;
- private String errMessage = "";
- private int timeOut = 3000;
- private DateTime cmdDate;
- private Delegate devent;
- public CmdInfo(prt_cmd_define cmd_define, int receiverID)
- {
- try
- {
- this.cmd_define = cmd_define;
- this.ReceiverID = receiverID;
- this.devent = null;
- init();
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- public CmdInfo(prt_res_define res_define, int receiverID, int loopNo, int boardNo, int repeaterNo)
- {
- try
- {
- this.res_define = res_define;
- this.ReceiverID = receiverID;
- this.commId = 1;
- this.LoopNo = loopNo;
- this.BoardNo = boardNo;
- this.RepeaterNo = repeaterNo;
- this.devent = null;
- init();
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- public CmdInfo(prt_cmd_define cmd_define, int receiverID, int commId, int loopNo, int boardNo, int repeaterNo, Delegate dele)
- {
- try
- {
- this.cmd_define = cmd_define;
- this.ReceiverID = receiverID;
- this.commId = commId;
- this.LoopNo = loopNo;
- this.BoardNo = boardNo;
- this.RepeaterNo = repeaterNo;
- this.devent = dele;
- init();
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- public CmdInfo(prt_cmd_define cmd_define, int receiverID, int commId, int loopNo, int boardNo, Delegate dele)
- {
- try
- {
- this.cmd_define = cmd_define;
- this.ReceiverID = receiverID;
- this.commId = commId;
- this.LoopNo = loopNo;
- this.BoardNo = boardNo;
- this.devent = dele;
- init();
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- private void init()
- {
- try
- {
- this.response = false;
- this.cmdDate = DateTime.Now;
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
-
-
-
-
-
-
-
- public prt_cmd_define Command { get { return cmd_define; } }
- public prt_res_define ResCommand { get { return res_define; } set { this.res_define = value; } }
- public int TimeOut { get { return this.timeOut; } }
- public Boolean Response { get { return this.response; } set { this.response = value; } }
- public int receiverID { get { return this.ReceiverID; } set { this.ReceiverID = value; } }
- public int CommId { get { return this.commId; } set { this.commId = value; } }
- public int loopNo { get { return this.LoopNo; } set { this.LoopNo = value; } }
- public int boardNo { get { return this.BoardNo; } set { this.BoardNo = value; } }
- public int repeaterNo { get { return this.RepeaterNo; } set { this.RepeaterNo = value; } }
- public int invorkNo { get { return this.InvorkNo; } }
- public Delegate dEvent { get { return this.devent; } set { this.devent = value; } }
-
- public object CommandData { get { return this.commandData; } set { this.commandData = value; } }
- public object ResponseData { get { return responseData; } set { responseData = value; response = true; } }
- public object ErrResponseData { get { return this.responseData; } set { this.responseData = value; this.errResponse = true; } }
- public Boolean ErrResponse { get { return this.errResponse; } }
- public String ErrMessage { get { return this.errMessage; } }
- public String Devicetype { get { return this.devicetype; } set { this.devicetype = value; } }
- public int DeviceId { get { return this.deviceId; } set { this.deviceId = value; } }
- public String CommandType { get { return this.commandType; } set { this.commandType = value; } }
- public String SubType { get { return this.subType; } set { this.subType = value; } }
- public String ApplyRange { get { return this.applyRange; } set { this.applyRange = value; } }
- public int Status { get { return this.status; } set { this.status = value; } }
-
- public byte AnalogDetecterFault { get { return this.analogDetecterFault; } set { this.analogDetecterFault = value; } }
- public byte AnalogDetecterPreFire { get { return this.analogDetecterPreFire; } set { this.analogDetecterPreFire = value; } }
- public byte AnalogDetecterFireNight { get { return this.analogDetecterFireNight; } set { this.analogDetecterFireNight = value; } }
- public byte AnalogDetecterFireDay { get { return this.analogDetecterFireDay; } set { this.analogDetecterFireDay = value; } }
- }
-
- public class EventLogInfo : IDisposable // cyim 2017.01.02 : Memory leak
- {
- public bool updated = false;
- public String eventId;
- public DateTime eventTime;
- private String eventType;
- private String eventTypeName;
- private MappingStatus eventStatus = MappingStatus.Normal;
- private int receiverID = 0;
- private int commId = 1;
- private int loopNo = 0;
- private int boardNo = 0;
- private int repeaterNo = 0;
- private string inoutType = "";
- private int deviceId = 0;
- private string deviceMessage = "";
- private string message = "";
- private int dataValue = 0;
-
- private bool liveMsgFlag = false;
-
-
- public void Dispose()
- {
- updated = false;
- eventId = "";
-
- eventType = "";
- eventTypeName = "";
- eventStatus = MappingStatus.Normal;
- receiverID = 0;
- commId = 1;
- loopNo = 0;
- boardNo = 0;
- repeaterNo = 0;
- inoutType = "";
- deviceId = 0;
- deviceMessage = "";
- message = "";
- dataValue = 0;
- liveMsgFlag = false;
- }
- public EventLogInfo(string eventId)
- {
- try
- {
- this.eventId = eventId;
-
- this.eventType = eventId.Substring(19, 2);
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- public void UpdateEventLogID(string eventId)
- {
- this.eventId = eventId;
- }
- public String EventId { get { return this.eventId; } }
- public DateTime EventTime { get { return this.eventTime; } set { this.eventTime = value; } }
- public String EventType { get { return this.eventType; } set { this.eventType = value; } }
- public String EventTypeName { get { return this.eventTypeName; } set { this.eventTypeName = value; } }
- public MappingStatus EventStatus { get { return this.eventStatus; } set { this.eventStatus = value; } }
- public String DeviceMessage { get { return this.deviceMessage; } set { this.deviceMessage = value; } }
- public String Message { get { return this.message; } set { this.message = value; } }
- public int ReceiverID { get { return this.receiverID; } set { this.receiverID = value; } }
- public int CommId { get { return this.commId; } set { this.commId = value; } }
- public int LoopNo { get { return this.loopNo; } set { this.loopNo = value; } }
- public int BoardNo { get { return this.boardNo; } set { this.boardNo = value; } }
- public int RepeaterNo { get { return this.repeaterNo; } set { this.repeaterNo = value; } }
- public String InoutType { get { return this.inoutType; } set { this.inoutType = value; } }
- public int DeviceId { get { return this.deviceId; } set { this.deviceId = value; } }
- public int DataValue { get { return this.dataValue; } set { this.dataValue = value; } }
-
-
-
-
- public bool LiveMsgFlag { get { return this.liveMsgFlag; } set { this.liveMsgFlag = value; } }
-
- }
- }
|