예제 #1
0
 private AlarmControl AddAlarm(int slave, byte alertCode)
 {
     AlarmControl alarm = new AlarmControl(slave, alertCode);
     alarms.Add(alarm);
     this.Controls.Add(alarm);
     return alarm;
 }
예제 #2
0
        private void RemoveAlarm()
        {
            AlarmControl alarm = alarms[alarms.Count - 1];

            this.Controls.Remove(alarm);
            alarms.RemoveAt(alarms.Count - 1);
            alarm.Dispose();
        }
예제 #3
0
        private AlarmControl AddAlarm(int slave, byte alertCode)
        {
            AlarmControl alarm = new AlarmControl(slave, alertCode);

            alarms.Add(alarm);
            this.Controls.Add(alarm);
            return(alarm);
        }
예제 #4
0
 private void tmrRemoteCtrl_Tick(object sender, EventArgs e)
 {
     if (this.alarms.Count > 0)
     {
         AlarmControl alarm = this.alarms[ctrlIndex % this.alarms.Count];
         ctrlIndex++;
         foreach (var mt in Program.MeterManager.CTMeters.Values)
         {
             runningNum = ++runningNum % ushort.MaxValue;
             mt.SetCommand(runningNum, alarm.Slave, 1, (int)alarm.AlertCode);
         }
     }
 }
예제 #5
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            AlarmControl alarm = AddAlarm(alarmIndex++ + initSlave, 0);

            alarm.Location = new Point(30, 40 + 29 * alarmIndex);
        }