예제 #1
0
        public void RemoveCarrierWarn(CarrierWarnE warntype, ushort devid)
        {
            Warning warn = List.Find(c => c.type == (byte)warntype && c.dev_id == devid && !c.resolve);

            if (warn != null)
            {
                RemoveWarning(warn);
            }
        }
예제 #2
0
        public void AddCarrierWarn(CarrierWarnE warntype, ushort devid, ushort alertidx)
        {
            Warning warn = List.Find(c => c.type == (byte)warntype && c.dev_id == devid && !c.resolve);

            if (warn == null)
            {
                warn = new Warning()
                {
                    dev_id   = devid,
                    type     = (byte)warntype,
                    track_id = alertidx
                };
                string devname = PubMaster.Device.GetDeviceName(devid);
                string warnmsg = PubMaster.Dic.GetDtlStrCode(warntype.ToString());
                warn.content = devname + ": " + warnmsg;
                AddWaring(warn);
            }
        }