예제 #1
0
        private void AddNewAlarmSensor(ISensorProperty s)
        {
            RigEx.WriteLineColors($"sensor detected: {s.Name} =>   {s.Dictionary.Keys.Last().ToString()}".AddTimeStamp(), ConsoleColor.DarkGray);
            var alarmsensor = new AlarmSensor(s, ctrl);

            alarmsensor.AlarmAction      += OnAlarmAction;
            alarmsensor.StopMiningAction += OnStopMiningAction;
            ctrl.GetAlarmdata.AddifNew(alarmsensor);
        }
예제 #2
0
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (this == null || obj == null)
            {
                return(false);
            }
            AlarmSensor c = obj as AlarmSensor;

            return(sensor.Name == c?.sensor.Name &&
                   sensor.HwType == c.sensor.HwType &&
                   sensor.Dictionary.Count == c.sensor.Dictionary.Count && !sensor.Dictionary.Except(c.sensor.Dictionary).Any());

            return(base.Equals(obj));
        }