public TreeNodeTmlViewModel(NodeBaseNode mvvmFather, IIEquipmentInfo terminalInfomation) { this.NodeType = TypeOfTreeNode.IsTml; Visi = Visibility.Visible; this._father = mvvmFather; Md5 = 0; //TreeSingleViewModel.RegisterNodeToControl(this); if (terminalInfomation == null) { this.NodeName = "加载出错"; } else { this.NodeName = terminalInfomation.RtuName; // this.ImagesIcon = ImageResources.GetTmlTreeIcon(6); this.NodeId = terminalInfomation.RtuId; Md5 = terminalInfomation.Md5; PicIndex = 3005; } this.ReUpdate(9); UpdateTmlStateInfomation(); }
public TreeNodeConcentratorViewModel(NodeBaseNode mvvmFather, IIEquipmentInfo terminalInfomation) { this.NodeType = TypeOfTreeNode.IsConcentrator; Visi = Visibility.Visible; this._father = mvvmFather; Md5 = 0; //TreeSingleViewModel.RegisterNodeToControl(this); if (terminalInfomation == null) { this.NodeName = "加载出错"; } else { this.NodeName = terminalInfomation.RtuName; // this.ImagesIcon = ImageResources.GetTmlTreeIcon(6); this.NodeId = terminalInfomation.RtuId; Md5 = terminalInfomation.Md5; RtuModelss = terminalInfomation.RtuModel; } GetNoUsedCount(); ReUpdate(11); }
public TreeNodeLineViewModel(NodeBaseNode mvvmFather, string name, int lineId, bool beenUsed) { this.NodeType = TypeOfTreeNode.IsLine; Visi = Visibility.Visible; this._father = mvvmFather; Md5 = 0; RightMenuKey = "10909"; LineId = lineId; this.NodeName = name; // this.ImagesIcon = ImageResources.GetTmlTreeIcon(6); this.NodeId = lineId; if (beenUsed) { IsUsed = Visibility.Visible; NoUsed = Visibility.Collapsed; ConcentratorCount = 0; } else { IsUsed = Visibility.Collapsed; NoUsed = Visibility.Visible; ConcentratorCount = 1; } UpdateTmlStateInfomation(); }
/// <summary> /// 当选择的终端发送变化时,如果 /// </summary> public override void OnNodeSelectActive() { ////base.OnNodeSelect(); ////发布事件 选中当前节点 //var args = new PublishEventArgs //{ // EventType = PublishEventType.Core, // EventId = Sr.EquipmentGroupInfoHolding.Services.EventIdAssign.MainSingleTreeNodeActive, //}; //args.AddParams(NodeId); //args.AddParams(2); //EventPublisher.EventPublish(args); if (this.ChildTreeItems.Count > 0) { this.ChildTreeItems.Clear(); } // this.ThisNodeAddLoopsNode(); this.ThisNodeAddPartsNode(); this.IsExpanded = true; TreeNodeConcentratorViewModel.CurrentSelectedTreeNode = this; //ResetContextMenu(); var ar = new PublishEventArgs() { EventId = Sr.EquipmentInfoHolding.Services.EventIdAssign.EquipmentSelected, EventType = PublishEventType.Core }; ar.AddParams(this.Father.NodeId); //终端地址 ar.AddParams(this.NodeId); //集中器地址 ar.AddParams(0); //线路ID,0表示全部线路 EventPublisher.EventPublish(ar); }