Exemple #1
0
 protected virtual void OnStatusChanged(AlarmStatusChangedEventArgs e)
 {
     if (StatusChanged != null)
     {
         StatusChanged(this, e);
     }
 }
 protected virtual void OnStatusChanged(AlarmStatusChangedEventArgs e)
 {
     //AlarmStatusChangedEventHandler handler = StatusChanged;
     if (StatusChanged != null)
     {
         StatusChanged(this, e);
     }
 }
 public GPIOAlarm(int id, string name, string address)
 {
     Id        = id;
     Name      = name;
     Address   = address;
     pin       = GPIOService.GetGPIOPin(Address);
     pinConfig = pin.Input().Name(Name).OnStatusChanged(b =>
     {
         State = b ? true : false;
         //Console.WriteLine("Alarm {0} {1}", Name, b ? "on" : "off");
         AlarmStatusChangedEventArgs e = new AlarmStatusChangedEventArgs();
         e.Value = b;
         OnStatusChanged(e);
     });
     Id = id;
     GPIOService.Gpio.Add(pinConfig);
 }