void LPRPostResultsLoop() { while (!m_Stop) { Thread.Sleep(100); LPR_RESULT_TO_POST r = m_LPRResultsToPostQ.Dequeue(); if (r != null) { this.BeginInvoke((MethodInvoker) delegate { this.PostLPRString(r.chan, r.result); }); } } }
// //////////////////////////// // // // Receive New LPR results and display void m_LPREngine_OnNewPlateEvent(FRAME frame) { int chan = frame.SourceChannel; StringBuilder sb = new StringBuilder(); foreach (string s in frame.PlateNumberLatin) { sb.Append(s); sb.Append(", "); } //string result = sb.ToString(); // this.BeginInvoke((MethodInvoker)delegate { this.PostLPRString(chan,result); }); LPR_RESULT_TO_POST result = new LPR_RESULT_TO_POST(); result.result = sb.ToString(); result.chan = chan; m_LPRResultsToPostQ.Enqueue(result); }