Example #1
0
        public void removeAlarm(PartAlarm pa)
        {
            partAlarmsPanel.Controls.Remove(pa);

            if (information.isUnqueued(pa))
            {
                information.removeUnqueuedAlarm(pa);
            }
            else
            {
                information.removeAlarm(pa);
            }

            List <PartAlarm> paList = new List <PartAlarm>();

            foreach (PartAlarm p in partAlarmsPanel.Controls)
            {
                paList.Add(p);
            }

            foreach (PartAlarm p in paList)
            {
                partAlarmsPanel.Controls.Remove(p);
            }

            foreach (PartAlarm p in paList)
            {
                slideUpAlarm(p);
            }
        }
Example #2
0
        public void personalAlarmIsInQueue(PartAlarm pa, Card c)
        {
            removeAlarm(pa);
            String alarmTime = pa.getAlarmTime();

            partAlarmsPanel.AutoScrollPosition = new Point(0, 0);
            PartAlarm pa1       = new PartAlarm(pa.getPartType(), pa.getLine(), pa.getStation(), alarmTime, pa.getDeskNot(), pa.getEmailNot(), pa.getN(), c, this);
            int       numAlarms = partAlarmsPanel.Controls.Count;
            int       locY      = numAlarms * pa1.Height + 10 * numAlarms;

            pa1.Location = new Point(partAlarmsPanel.Location.X + partAlarmsPanel.Width / 2 - pa1.Width / 2, locY);
            partAlarmsPanel.Controls.Add(pa1);
            if (c != null)
            {
                if (c.getTimeRemaining() / 60 >= Int32.Parse(alarmTime))
                {
                    information.addAlarm(pa1);
                    pa1.update_alarm(); //gotta set the timer
                    pa1.startTimer();   //gotta start the timer
                }
            }
            else
            {
                Debug.WriteLine("card is still null");
                information.addAlarmNotQueued(pa1);
            }
        }
Example #3
0
        private void slideUpAlarm(PartAlarm pa1)
        {
            int numAlarms = partAlarmsPanel.Controls.Count;
            int locY      = numAlarms * pa1.Height + 10 * numAlarms;

            pa1.Location = new Point(partAlarmsPanel.Location.X + partAlarmsPanel.Width / 2 - pa1.Width / 2, locY);
            partAlarmsPanel.Controls.Add(pa1);
        }
Example #4
0
        public void addAlarmtoPanel(String partType, String lineNum, String station, String alarmTime, Boolean desktopNotification, Boolean emailNotification, int n, Timer timer1)
        {
            PartAlarm pa1       = new PartAlarm(partType, lineNum, station, alarmTime, desktopNotification, emailNotification, n, timer1);
            int       numAlarms = partAlarmsPanel.Controls.Count;
            int       locY      = numAlarms * pa1.Height + 10 * numAlarms;

            pa1.Location = new Point(partAlarmsPanel.Location.X + partAlarmsPanel.Width / 2 - pa1.Width / 2, locY);
            partAlarmsPanel.Controls.Add(pa1);
            alarms.Add(pa1);
            information.addAlarm(pa1);
        }
Example #5
0
        public void addAlarmtoPanel(string partType, string lineNum, string station, string alarmTime, bool desktopNotification, bool emailNotification, int n, Timer timer1)
        {
            partAlarmsPanel.AutoScrollPosition = new Point(0, 0);
            Card      c         = information.getCard(partType, Int32.Parse(lineNum));
            PartAlarm pa1       = new PartAlarm(partType, lineNum, station, alarmTime, desktopNotification, emailNotification, n, c, this);
            int       numAlarms = partAlarmsPanel.Controls.Count;
            int       locY      = numAlarms * pa1.Height + 10 * numAlarms;

            pa1.Location = new Point(partAlarmsPanel.Location.X + partAlarmsPanel.Width / 2 - pa1.Width / 2, locY);
            partAlarmsPanel.Controls.Add(pa1);
            if (c != null)
            {
                if (c.getTimeRemaining() / 60 >= Int32.Parse(alarmTime))
                {
                    information.addAlarm(pa1);
                    pa1.update_alarm(); //gotta set the timer
                    pa1.startTimer();   //gotta start the timer
                }
            }
            else
            {
                information.addAlarmNotQueued(pa1);
            }
        }
Example #6
0
 public void removeAlarm(PartAlarm pa)
 {
     this.alarms.Remove(pa);
 }
Example #7
0
 public void addAlarm(PartAlarm pa)
 {
     this.alarms.Add(pa);
 }
Example #8
0
 public void removeAlarm(PartAlarm pa)
 {
     alarms.Remove(pa);
     partAlarmsPanel.Controls.Remove(pa);
     information.removeAlarm(pa);
 }
Example #9
0
 public bool isUnqueued(PartAlarm pa)
 {
     return(this.alarmsNotQueued.Contains(pa));
 }
Example #10
0
 public void removeUnqueuedAlarm(PartAlarm pa)
 {
     this.alarmsNotQueued.Remove(pa);
 }
Example #11
0
 public void addAlarmNotQueued(PartAlarm pa)
 {
     this.alarmsNotQueued.Add(pa);
 }