Ejemplo 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);
             }
     }
 }
Ejemplo n.º 2
0
 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);
         }
     }
 }
Ejemplo n.º 3
0
 static void CanFrame_Recieved(object sender, CanFramesReceiveEventArgs e)
 {
     foreach (var f in e.Frames)
         PrintFrame(f);
 }
Ejemplo 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);
     }
 }
Ejemplo n.º 5
0
 void Handler_FrameReceived(object sender, CanFramesReceiveEventArgs e)
 {
     Enqueue(e.Frames);
 }
Ejemplo n.º 6
0
 void Handler_Recieved(object sender, CanFramesReceiveEventArgs e)
 {
 }
Ejemplo n.º 7
0
 void Handler_FrameReceived(object sender, CanFramesReceiveEventArgs e)
 {
     Enqueue(e.Frames);
 }