Exemplo n.º 1
0
 public Form1()
 {
     InitializeComponent();
     Thread.CurrentThread.Priority = ThreadPriority.AboveNormal;
     m_DelegateSetLabelText = new DelegateSetLabelText(this.SetLabelCaption);
     m_DelegateSetProgressValue = new DelegateSetProgressValue(this.SetProgressValue);
     Application.ApplicationExit += new EventHandler(Application_ApplicationExit);
     _cancomms = new ME7Communication();
     _cancomms.onCanInfo += new ME7Communication.CanInfo(_comms_onCanInfo);
     _cancomms.onCanCount += new ME7Communication.CanCount(_cancomms_onCanCount);
     _cancomms.onWriteProgress += new ME7Communication.WriteProgress(_cancomms_onWriteProgress);
     _cancomms.onCanBusLoad += new ME7Communication.CanBusLoad(_cancomms_onCanBusLoad);
     _cancomms.setCANDevice("LAWICEL"); //TODO: Make this selectable
     _cancomms.onReadProgress += new ME7Communication.ReadProgress(_cancomms_onReadProgress);
     //_comms = new ME7KLineCommunication();
     //_comms.LogFolder = Application.StartupPath;
     //_comms.EnableLogging = true;
     //_comms.onStatusChanged += new ICommunication.StatusChanged(_comms_onStatusChanged);
     //_comms.onECUInfo += new ICommunication.ECUInfo(_comms_onECUInfo);
 }
Exemplo n.º 2
0
 public Form1()
 {
     InitializeComponent();
     Thread.CurrentThread.Priority = ThreadPriority.AboveNormal;
     m_DelegateSetLabelText        = new DelegateSetLabelText(this.SetLabelCaption);
     m_DelegateSetProgressValue    = new DelegateSetProgressValue(this.SetProgressValue);
     Application.ApplicationExit  += new EventHandler(Application_ApplicationExit);
     _cancomms                  = new ME7Communication();
     _cancomms.onCanInfo       += new ME7Communication.CanInfo(_comms_onCanInfo);
     _cancomms.onCanCount      += new ME7Communication.CanCount(_cancomms_onCanCount);
     _cancomms.onWriteProgress += new ME7Communication.WriteProgress(_cancomms_onWriteProgress);
     _cancomms.onCanBusLoad    += new ME7Communication.CanBusLoad(_cancomms_onCanBusLoad);
     _cancomms.setCANDevice("LAWICEL"); //TODO: Make this selectable
     _cancomms.onReadProgress += new ME7Communication.ReadProgress(_cancomms_onReadProgress);
     //_comms = new ME7KLineCommunication();
     //_comms.LogFolder = Application.StartupPath;
     //_comms.EnableLogging = true;
     //_comms.onStatusChanged += new ICommunication.StatusChanged(_comms_onStatusChanged);
     //_comms.onECUInfo += new ICommunication.ECUInfo(_comms_onECUInfo);
 }
Exemplo n.º 3
0
 void _comms_onCanInfo(object sender, ME7Communication.CanInfoEventArgs e)
 {
     if (e.Type == ActivityType.DownloadingFlash)
     {
         SetLabelText(label5, e.Info);
         Application.DoEvents();
     }
     else
     {
         AddToLogItem(e.Info);
     }
 }
Exemplo n.º 4
0
 void _cancomms_onWriteProgress(object sender, ME7Communication.WriteProgressEventArgs e)
 {
     int percentage = (int)e.Percentage;
     if (progressBar1.Value != percentage)
     {
         progressBar1.Value = percentage;
         Application.DoEvents();
     }
 }
Exemplo n.º 5
0
 void _cancomms_onCanCount(object sender, ME7Communication.CanCountEventArgs e)
 {
     if (!_holdUpdate)
     {
         SetLabelText(lblRxCount, e.RxCount.ToString());
         SetLabelText(lblTxCount, e.TxCount.ToString());
         SetLabelText(lblErrCount, e.ErrCount.ToString());
         _holdUpdate = true;
     }
 }
Exemplo n.º 6
0
 void _cancomms_onCanBusLoad(object sender, ME7Communication.CanbusLoadEventArgs e)
 {
     SetProgressBarValue(progressBar2, Convert.ToInt32(e.Load));
     SetLabelText(label6, e.Load.ToString("F1") + " %");
 }