public void StatusEventTest() { using (var manager = new IpModuleManager(module)) { manager.Login(); manager.GetAlarmInformation(); manager.AlarmStatusUpdate += (sender, args) => Console.Write("raised"); manager.MonitorEvents(); manager.GetStatus(); Thread.Sleep(1500); manager.GetStatus(); manager.ShouldRaise("AlarmStatusUpdate"); manager.Logout(); } }
private void Dt_Tick(object sender, EventArgs e) { ipmm.GetStatus(); //SqlCommand cmd = new SqlCommand("Select * from ParadoxSystem", conn); //using (SqlDataReader sdr = cmd.ExecuteReader()) //{ // while (sdr.Read()) // { // if (Convert.ToInt32(sdr[0]) == 1) // { // ipmm.AlarmAction(ParadoxIp.Enum.PartitionNumber.All, ParadoxIp.Enum.AlarmMode.RegularArm); // } // else if (Convert.ToInt32(sdr[0]) == 0) // { // ipmm.AlarmAction(ParadoxIp.Enum.PartitionNumber.All, ParadoxIp.Enum.AlarmMode.Disarm); // } // } //} }
public void GetStatusTest() { using (var manager = new IpModuleManager(module)) { manager.Login(); manager.GetAlarmInformation(); manager.GetStatus(); manager.Logout(); } }
public string Get(ZoneStatusRequest request) { if (statusThread == null || !statusThread.IsAlive) { manager.GetStatus(); } var device = manager.Devices.SingleOrDefault(d => d.ZoneId.ToString() == request.ZoneId); if (device != null) { if (request.SendEvent && callbacks != null) { callbacks.PutDeviceUpdate(device); } return(device.Status.ToString()); } return(DeviceStatus.Unknown.ToString()); }