Esempio n. 1
0
        public static void UpdateLduInfo(Wlst.client.LduLineData info)
        {
            var tmp = new Tuple <int, int>(info.LduId, info.LineId);

            if (Info.ContainsKey(tmp))
            {
                Info[tmp] = info;
            }
            else
            {
                Info.TryAdd(tmp, info);
            }
        }
Esempio n. 2
0
        public SelectDataModel(Wlst.client.LduLineData item)
        {
            //var t =
            //   Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems[rtuId]
            //   as Sr.EquipmentInfoHolding.Model.Wj1090Ldu;

            //if (t == null)
            //    return;


            //var tmp = new List<LduLineParameter>();
            //var ntg = (from txr in t.WjLduLines orderby txr.Value.LduLineId ascending select txr.Value).ToList();

            var dh = Wlst.Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.GetInfoById(item.LduId);//.GetEquipmentInfo(item.LduId);

            if (dh != null && dh.RtuFid != 0)
            {
                AttachRtuId = dh.RtuFid;

                //var dx = Wlst.Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.GetInfoById(AttachRtuId);
                //RtuIDX = Convert.ToString(dx.RtuPhyId);
                //RtuName = dx.RtuName;
            }

            //AttachRtuId = item.AttachRtuId;
            RtuId = item.LduId;

            DateCreate = new DateTime(item.DateCreate);
            LineLoopId = item.LineId;
            if (dh != null && dh.RtuName != null)
            {
                LineLoopName = dh.GetLoopName(item.LineId);                               //todo test
            }
            V                         = item.V;
            A                         = item.A;
            PowerActive               = item.PowerActive;
            PowerReActive             = item.PowerReActive;
            PowerFactor               = item.PowerFactor;
            BrightRate                = item.BrightRate;
            Single                    = item.Single;
            Impedance                 = item.Impedance;
            NumofUsefullSingleIn12Sec = item.NumofUsefullSingleIn12Sec;
            NumofSingleIn12Sec        = item.NumofSingleIn12Sec;
            //FlagDetection = item.FlagDetection;
            //FlagAlarm = item.FlagAlarm;

            string temp = Convert.ToString(item.FlagAlarm, 2);

            if (temp.Length < 8)
            {
                int i = 0;
                while (8 - temp.Length > 0)
                {
                    temp = "0" + temp;
                    i++;
                }
            }
            FlagAlarm = temp;
            temp      = Convert.ToString(item.FlagDetection, 2);
            if (temp.Length < 8)
            {
                int i = 0;
                while (8 - temp.Length > 0)
                {
                    temp = "0" + temp;
                    i++;
                }
            }
            FlagDetection = temp;

            var tmps = Ux.Wj1090Module.Services.Alarm.GetInfo(item.FlagAlarm, item.FlagDetection);

            if (tmps.Item1 && tmps.Item2)
            {
                FlagIsDao = "被盗-短路";
            }
            else if (tmps.Item1)
            {
                FlagIsDao = "被盗";
            }
            else if (tmps.Item2)
            {
                FlagIsDao = "短路";
            }
            else
            {
                FlagIsDao = "正常";
            }
        }