Example #1
0
 private void SignalIsChanged(object sender, SignalChangedEventArgs e)
 {
     for (int i = 0; i < ioList.Count; i++)
     {
         if (listViewMonitor.Items[i].Text == sender.ToString())
         {
             listViewMonitor.Items[i].SubItems[1].Text = e.NewSignalState.Value.ToString();
         }
     }
 }
Example #2
0
        // method to do something if IO is on or off.
        private void SignalChangedEven(Object sender, SignalChangedEventArgs e)
        {
            DigitalSignal digitalSig = (DigitalSignal)Sig;

            int val = digitalSig.Get();

            if (val == 1)
            {
                Console.WriteLine();
                Console.WriteLine($"Signal {Sig.Name.ToString()} is changed");
                Console.WriteLine("Text message was sent.");

                //gmEmail = new GmailEmail();
                //gmEmail.SetUpEmail();

                outEmail = new OutlookEmail();
                outEmail.SendThroughOUTLOOK();
            }
        } // end of SignalChangedEven method
 //为了避免界面线程和主线程冲突,采用委托方式
 private void IO_OUT_StateChanged(object sender, SignalChangedEventArgs e)
 {
     this.Invoke(new EventHandler(Update_OUT_Status), sender, e);
 }
		void OnSignalChanged (object sender, SignalChangedEventArgs args)
		{
			OnSignalChanged (args);
		}
Example #5
0
 void OnSignalChanged(object s, SignalChangedEventArgs args)
 {
     OnSignalChanged(args);
 }
Example #6
0
 void SignalChanged(object sender, SignalChangedEventArgs e)
 {
     this.Invoke(new EventHandler <SignalChangedEventArgs>(SignalIsChanged), new Object[] { sender, e });
 }
 internal void SignalChangedHandler(object sender,
                                    SignalChangedEventArgs e)
 {
     OnSignalChanged(e.Time + GetDelay());
 }
Example #8
0
 private void OnSignalChangedEvent(object sender, SignalChangedEventArgs e)
 {
     _console.OutputEvent($"Signal changed to {e.State}.");
 }