Beispiel #1
0
        public static void CurrentSelectedGrpIdChanged(TreeNodeBaseNode info)
        {
            int xg = xyrdsfd(info);

            if (xg == 0)
            {
                return;
            }
            if (CurrentSelectedGrpId == xg)
            {
                return;
            }
            CurrentSelectedGrpId = xg;

            TreeTabRtuSet.TabRtuHolding.GetRtuLstByIdx(CurrentSelectedGrpId);

            var ins = new PublishEventArgs()
            {
                EventType = PublishEventType.Core,
                EventId   =
                    Wlst.Sr.EquipmentInfoHolding.Services.EventIdAssign.RtuGroupSelectdWantedMapUp
            };

            ins.AddParams(TreeTabRtuSet.TabRtuHolding.GetRtuLstByIdx(CurrentSelectedGrpId));

            lastsndeventtime = DateTime.Now.Ticks;
            EventPublisher.EventPublish(ins);
        }
Beispiel #2
0
        public TreeNodeItemAttachEquViewModel(TreeNodeBaseNode mvvmFather, Wlst.Sr.EquipmentInfoHolding.Model.WjParaBase attachInfomation)
        {
            this.NodeType = TypeOfTabTreeNode.IsTmlParts;
            Visi          = Visibility.Visible;
            this._father  = mvvmFather;

            if (attachInfomation == null)
            {
                this.NodeName = "加载出错";
            }
            else
            {
                this.NodeName = attachInfomation.RtuName;
                var running = Wlst.Sr.EquipmentInfoHolding.Services.RunningInfoHold.GetRunInfo(attachInfomation.RtuId);
                if (running != null && running.ErrorCount > 0)
                {
                    this.ImagesIcon = ImageResources.GetEquipmentIcon((int )attachInfomation.RtuModel + 1);
                }
                else
                {
                    this.ImagesIcon = ImageResources.GetEquipmentIcon((int)attachInfomation.RtuModel);
                }

                this.NodeId = attachInfomation.RtuId;
                this.Md5    = attachInfomation.DateUpdate;
            }
        }
Beispiel #3
0
 public static void AddAllTmpNodess(TreeNodeBaseNode node)
 {
     if (AllTmpNodess.ContainsKey(node.NodeId))
     {
         return;
     }
     AllTmpNodess.Add(node.NodeId, node);
     // tnb.ChildTreeItems.Add(node);
 }
        public TreeNodeItemTmlViewModel(TreeNodeBaseNode mvvmFather, Wlst.Sr.EquipmentInfoHolding.Model.WjParaBase terminalInfomation)
        {
            this.NodeType = TypeOfTabTreeNode.IsTml;
            Visi          = Visibility.Visible;
            this._father  = mvvmFather;
            Md5           = 0;

            //TreeSingleViewModel.RegisterNodeToControl(this);

            if (terminalInfomation == null)
            {
                this.NodeName = "加载出错";
            }
            else
            {
                modelx        = (int )terminalInfomation.RtuModel;
                this.NodeName = terminalInfomation.RtuName;
                // this.ImagesIcon = ImageResources.GetEquipmentIcon(1010198);
                this.NodeId = terminalInfomation.RtuId;
                Md5         = terminalInfomation.DateUpdate;
                UpdateTmlStateInfomation();
                PhyId = terminalInfomation.RtuPhyId;


                var tmps = terminalInfomation as Wlst.Sr.EquipmentInfoHolding.Model.Wj3005Rtu;
                if (tmps != null && tmps.WjGprs != null)
                {
                    PhoneNumber = tmps.WjGprs.MobileNo;
                }
            }

            if (!BaseNodes.Nodess.ContainsKey((NodeId)))
            {
                BaseNodes.AddNode(this);
            }
            else
            {
                //Wlst.Cr.CoreMims.ShowMsgInfo.ShowNewMsg.AddNewShowMsg(NodeId, "0000", OperatrType.SystemInfo, "Error");
            }
        }
Beispiel #5
0
        private static int xyrdsfd(TreeNodeBaseNode info)
        {
            var tmp = info;

            while (tmp.Father != null)
            {
                if (info.Father != null)
                {
                    tmp = info.Father;
                }
            }

            int x1 = tmp.NodeId;
            int x2 = 0;

            if (tmp.ChildTreeItems.Count > 0)
            {
                x2 = tmp.ChildTreeItems[0].NodeId;
            }

            foreach (var f in TreeTabRtuSet.TabRtuHolding.Info)
            {
                if (f.Value.GrpOrRtus.Contains(x1))
                {
                    return(f.Key);
                }
            }
            if (x2 > 0)
            {
                foreach (var f in TreeTabRtuSet.TabRtuHolding.Info)
                {
                    if (f.Value.GrpOrRtus.Contains(x2))
                    {
                        return(f.Key);
                    }
                }
            }
            return(0);
        }