void GetClientCh(HNCAPI.SEventElement ev, ref short clientNo, ref short ch) { short[] info = new short[2]; Buffer.BlockCopy(ev.buf, 0, info, 0, info.Length); clientNo = info[0]; ch = info[1]; }
private static void OnEventAvailable(HNCAPI.SEventElement e, Int16 clientNo) { SAlarmEvent almEV = new SAlarmEvent(); switch (e.code) { case EVENTDEF.ncEvtAlarmChg: //告警上报、消除 almEV = CGlbFunc.ByteToStructure <SAlarmEvent>(e.buf, 4); //从4开始偏移 GatherAlarmData(almEV, clientNo); break; case EVENTDEF.ncEvtPrgStart: UpdateLastProgStartTime(clientNo); break; default: break; } // monitor.Process(e); System.Threading.Tasks.Task.Run(() => monitor.Process(e)); }