123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Diagnostics;
- using System.Data;
- namespace FPER
- {
- //통신명령정보 [UI<----->Tprotocol간 ]
- public class CmdInfo
- {
- private prt_cmd_define cmd_define;
- private prt_res_define res_define;
- private int ReceiverID = 0; //수신기ID
- private int commId = 1; //1-front 2-back,3-io,4-keypad
- private int LoopNo = 0; //LoopNo
- private int BoardNo = 0; //BoardNo
- private int RepeaterNo = 0; //중계기No
- //private int RepeaterType = 0; //중계기Type 0-없음,1-2회로,2-4회로,3-아나로그연감지기,4-아나로그열감지기
- private int InvorkNo = 0; //명령ID
- private object commandData = null; //설정및쓰기 데이터
- private string devicetype = "C"; //회로 IN/OUT 타입
- private int deviceId = 0; //회로ID
- //CC-누적카운트, CV-전압
- private string commandType = null; //명령타입 2문자
- private string subType = "*"; //회로타입(회로타입차단용)
- private string applyRange = "A"; //차단레벨(회로타입차단용) A-All,C-Comm,B-Board,L-Loop,R-중계기,D-회로,I-입력회로,O-출력회로
- private int status = 0; //ON/OFF
- // cyim 2015.6.29 아날로그감지기 레벨값 쓰기 명령 프로토콜 추가
- 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; //타임아웃 3초
- 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 void setRepeaterInfo(int repeaterNo,bool CutFlag, int repeaterType)
- //{
- // this.RepeaterNo = repeaterNo;
- // this.RepeaterType = repeaterType;
- // //Set_Info_Data
- //}
- 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 int repeaterType { get { return this.RepeaterType; } }
- 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; } }
- // cyim 2015.6.29 아날로그감지기 레벨값 쓰기 명령 프로토콜 추가
- 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; //수신기ID
- private int commId = 1; //1-front 2-back,3-io,4-keypad
- private int loopNo = 0; //LoopNo
- private int boardNo = 0; //BoardNo
- private int repeaterNo = 0; //중계기No
- private string inoutType = ""; //회로 IN/OUT 타입
- private int deviceId = 0; //회로ID
- private string deviceMessage = ""; //회로 IN/OUT 타입
- private string message = ""; //회로 IN/OUT 타입
- private int dataValue = 0;
-
- private bool liveMsgFlag = false;
-
- // cyim 2017.01.02 : Memory leak
- public void Dispose()
- {
- updated = false;
- eventId = "";
- //eventTime
- eventType = "";
- eventTypeName = "";
- eventStatus = MappingStatus.Normal;
- receiverID = 0; //수신기ID
- commId = 1; //1-front 2-back,3-io,4-keypad
- loopNo = 0; //LoopNo
- boardNo = 0; //BoardNo
- repeaterNo = 0; //중계기No
- inoutType = ""; //회로 IN/OUT 타입
- deviceId = 0; //회로ID
- deviceMessage = ""; //회로 IN/OUT 타입
- message = ""; //회로 IN/OUT 타입
- dataValue = 0;
- liveMsgFlag = false;
- }
- public EventLogInfo(string eventId)
- {
- try
- {
- this.eventId = eventId;
- //this.Confirm_flag = "N";
- 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 String Confirm_remark { get { return this.confirm_remark; } set { this.confirm_remark = value; } }
- //public String Confirm_flag { get { return this.confirm_flag; } set { this.confirm_flag = value; } }
- //public String Confirm_person { get { return this.confirm_person; } set { this.confirm_person = value; } }
- //public DateTime Confirm_time { get { return this.confirm_time; } set { this.confirm_time = value; } }
- public bool LiveMsgFlag { get { return this.liveMsgFlag; } set { this.liveMsgFlag = value; } }
- //public bool CommandLogFlag { get { return this.commandLogFlag; } set { this.commandLogFlag = value; } }
- }
- }
|