Esempio n. 1
0
 void Port_Recieved(object sender, CanFramesReceiveEventArgs e)
 {
     lock (HandlerModels)
     {
         foreach (var f in e.Frames)
             if (!HandlerModels.Any(hm => hm.Descriptor == f.Descriptor && hm.Port == e.Port))
             {
                 var hm = new FrameHandlerModel(f.Descriptor, e.Port);
                 hm.Initialize();
                 Dispatcher.BeginInvoke((Action<FrameHandlerModel>)HandlerModels.Add, hm);
             }
     }
 }
 private static void OnCanFrameReceived(object Sender, CanFramesReceiveEventArgs FramesReceiveEventArgs)
 {
     foreach (CanFrame frame in FramesReceiveEventArgs.Frames.Where(f => DebugDescriptors.Contains(f.Descriptor)))
     {
         try
         {
             BlokFrame bf = BlokFrame.GetBlokFrame(frame);
             Debug.Indent();
             Debug.Print("  ---> {0,-30}     {1,-20}   {2,-10}   {3}", frame, bf.GetType().Name, BlokFrame.GetHalfset(frame.Descriptor), bf);
             Debug.Unindent();
         }
         catch (Exception e)
         {
             Debug.Print("  ---> Ошибка при декодировании сообщения {0}: {1}", frame, e.Message);
         }
     }
 }
Esempio n. 3
0
 static void CanFrame_Recieved(object sender, CanFramesReceiveEventArgs e)
 {
     foreach (var f in e.Frames)
         PrintFrame(f);
 }
Esempio n. 4
0
 private static void PortOnReceived(object Sender, CanFramesReceiveEventArgs FramesReceiveEventArgs)
 {
     using (var fs = new StreamWriter("can.log", true))
     {
         foreach (CanFrame frame in FramesReceiveEventArgs.Frames)
             fs.WriteLine("{0}   {1}", FramesReceiveEventArgs.Port, frame);
     }
 }
Esempio n. 5
0
 void Handler_FrameReceived(object sender, CanFramesReceiveEventArgs e)
 {
     Enqueue(e.Frames);
 }
Esempio n. 6
0
 void Handler_Recieved(object sender, CanFramesReceiveEventArgs e)
 {
 }
Esempio n. 7
0
 void Handler_FrameReceived(object sender, CanFramesReceiveEventArgs e)
 {
     Enqueue(e.Frames);
 }