/* * UNLOCK DOOR * Called by either PinFound or TagFound to unlock the door. */ private void UnlockDoor() { // Authorize access authorizedAccess = true; unlockTimerRunning = true; unlockedTimer.Restart(); // Blink LED Mainboard.SetDebugLED(true); System.Threading.Thread.Sleep(200); Mainboard.SetDebugLED(false); }
public void mov_det(GT.SocketInterfaces.InterruptInput input, bool value) { if (!value) { if (count == 0) { timer_cross.Start(); count++; } else { timer_cross.Restart(); } } }
private void DisplayMessage(string message) { // hide image imageDisplay.Visibility = Visibility.Collapsed; // show label label.Visibility = Visibility.Visible; label.TextContent = message; label.UpdateLayout(); if (hideMessageTimer == null) { hideMessageTimer = new GT.Timer(1000); hideMessageTimer.Tick += new GT.Timer.TickEventHandler(hideMessage_Tick); hideMessageTimer.Start(); } else { hideMessageTimer.Restart(); } }
void SetupDisplay() { button.TurnLedOff(); numericKey.TouchDown -= numericKey_TouchDown; foto.TouchDown -= new Microsoft.SPOT.Input.TouchEventHandler(getImage_TouchDown); sdcard.TouchDown -= sdcard_TouchDown; keyboardIcona.TouchDown -= keyboardIcona_TouchDown; utenteCorrente = new Utente(); canvas.Children.Clear(); userStr = ""; pinStr = ""; ntoccou = 0; ntoccop = 0; usernameValue.TextContent = ""; pinValue.TextContent = ""; canvas.SetMargin(5); canvas.Children.Add(header); canvas.Children.Add(foto); Canvas.SetBottom(foto, 25); Canvas.SetLeft(foto, 10); canvas.Children.Add(sdcard); Canvas.SetLeft(sdcard, 110); Canvas.SetBottom(sdcard, 25); canvas.Children.Add(keyboardIcona); Canvas.SetLeft(keyboardIcona, 210); Canvas.SetBottom(keyboardIcona, 25); foto.TouchDown += new Microsoft.SPOT.Input.TouchEventHandler(getImage_TouchDown); sdcard.TouchDown += sdcard_TouchDown; keyboardIcona.TouchDown += keyboardIcona_TouchDown; timer.Restart(); }
// Shows the window for "period" time public override void Show() { running = true; base.Show(); timerShowWindow.Restart(); }
void CheckOccupancyTime(string currentTime) { string[] currentTimeValues; string[] timeStart; string[] timeEnd; // Sample Time format : (HH:mm:ss) // Sample Range : 20:00, 06:00 //currentTime = "20:01"; currentTimeValues = currentTime.Split(':'); TimeType typeCurr = CheckTimeType(currentTimeValues); timeStart = areaDetails[1].Split(':'); TimeType typeTimeSt = CheckTimeType(timeStart); timeEnd = areaDetails[2].Split(':'); TimeType typeTimeEnd = CheckTimeType(timeEnd); if (typeCurr == TimeType.Morning) { if (typeTimeSt == TimeType.Morning) { if (Convert.ToInt32(currentTimeValues[0]) >= Convert.ToInt32(timeStart[0])) // Check time { if (!tmrObjectDetect.IsRunning) { // Start timer for Motion Detection tmrObjectDetect.Start(); } } } else { if (tmrObjectDetect.IsRunning) { if (Convert.ToInt32(currentTimeValues[0]) <= Convert.ToInt32(timeStart[0])) // Check time { tmrObjectDetect.Restart(); } else { tmrObjectDetect.Stop(); } } } } else if (typeCurr == TimeType.Day_Night) { if (typeTimeSt == TimeType.Day_Night) { if (Convert.ToInt32(currentTimeValues[0]) >= Convert.ToInt32(timeStart[0])) // Check time { if (!tmrObjectDetect.IsRunning) { // Start timer for Motion Detection tmrObjectDetect.Start(); } } } else { if (tmrObjectDetect.IsRunning) { if (Convert.ToInt32(currentTimeValues[0]) <= Convert.ToInt32(timeStart[0])) // Check time { tmrObjectDetect.Restart(); } else { tmrObjectDetect.Stop(); } } } } else { if (typeTimeSt == TimeType.MidNight) { if (Convert.ToInt32(currentTimeValues[0]) >= Convert.ToInt32(timeStart[0])) // Check time { if (!tmrObjectDetect.IsRunning) { // Start timer for Motion Detection tmrObjectDetect.Start(); } } } else { if (tmrObjectDetect.IsRunning) { if (Convert.ToInt32(currentTimeValues[0]) <= Convert.ToInt32(timeStart[0])) // Check time { tmrObjectDetect.Restart(); } else { tmrObjectDetect.Stop(); } } } } }