private DcmApp() { dcmTp = DcmTp.Instance(DcmAppRxIndication); queue = new DcmAppQueue(); parser = new DcmAppDataParserGroup(); parser.AddDcmAppDataParser(new DcmAppDataParserISO14229()); //失败处理结果 FailedHandleResult = new List <KeyValuePair <string, string> >(); FailedHandleResult.Add( new KeyValuePair <string, string>("HandleResult", "Failed with tp protocol")); FailedWithReceiveHandleResult = new List <KeyValuePair <string, string> >(); FailedWithReceiveHandleResult.Add( new KeyValuePair <string, string>("HandleResult", "Recieve error")); FailWithReceiveTimeoutHanldeResult = new List <KeyValuePair <string, string> >(); FailWithReceiveTimeoutHanldeResult.Add( new KeyValuePair <string, string>("HandleResult", "Receive Timeout")); FailWithSendHandleResult = new List <KeyValuePair <string, string> >(); FailWithSendHandleResult.Add( new KeyValuePair <string, string>("HandleResult", "Send error")); timer = DcmAppTimer.Instance(); timer.DcmAppTimerEvent += Dispatch; timer.Period = DispatchPeriod; timer.Started = true; //TODO: CanTp is unset }
public static DcmTp Instance(DcmAppRxIndicationCallback rxIndication = null) { if (instance == null) { lock (syncRoot) { if (instance == null) { instance = new DcmTp(rxIndication); } } } return(instance); }