Ejemplo n.º 1
0
 public void AddRelayNode(object sender, List<RelayNode> newRN)
 {
     if (newRN.Count != 0)
     {
         List<string> oldNames = new List<string>();
         foreach (RelayNode rn in newRN)
         {
             oldNames.Add(rn.Name);
             rn.ID = this.m_MaxID = (short)(this.m_MaxID + 1);
             rn.Label = this.SetRelayNodeLabelString(rn);
             ConfigSubFrames(rn);
             rn.RelayTerminal = ReadTable();
         }
         ProjectSingleton.CurrentProject.NeedPromptSave = true;
         this.m_RNList.AddRange(newRN);
         NERelayNodeEventArgs e = new NERelayNodeEventArgs(oldNames, newRN);
         this.OnRelayNodeAdd(sender, e);
     }
 }
Ejemplo n.º 2
0
 private void RealRenameRelayNode(object sender, string oldName, string newName)
 {
     List<string> oldNames = new List<string>();
     oldNames.Add(oldName);
     RelayNode rnByName = this.GetRelayNodeByName(oldName);
     List<RelayNode> rnList = new List<RelayNode>();
     rnList.Add(rnByName);
     new List<RelayNode>().Add((RelayNode)rnByName.Clone());
     rnByName.Name = newName;
     rnByName.Label = this.SetRelayNodeLabelString(rnByName);
     ProjectSingleton.CurrentProject.NeedPromptSave = true;
     NERelayNodeEventArgs e = new NERelayNodeEventArgs(oldNames, rnList);
     this.OnRelayNodeModified(sender, e);
 }
Ejemplo n.º 3
0
 public void LoadRNCollection(List<RelayNode> loadNodes, short loadId)
 {
     this.m_RNList = loadNodes;
     this.m_MaxID = loadId;
     NERelayNodeEventArgs e = new NERelayNodeEventArgs(new List<string>(this.GetRNNames()), loadNodes);
     this.OnRelayNodeAdd("LoadSubSystem", e);
 }
Ejemplo n.º 4
0
 public void ModifyRelayNode(object sender, List<RelayNode> modRelayNodeList)
 {
     if (modRelayNodeList.Count != 0)
     {
         List<string> oldNames = new List<string>();
         for (int i = 0; i < modRelayNodeList.Count; i++)
         {
             //按唯一标识ID进行查找,然后再修改,增加了安全性。就性能而言可能是多余的。
             RelayNode rnByID = this.GetRelayNodeByID(modRelayNodeList[i].ID);
             oldNames.Add(rnByID.Name);
             rnByID.CopyFrom(modRelayNodeList[i]);
             rnByID.Label = modRelayNodeList[i].Label = this.SetRelayNodeLabelString(rnByID);
             //this.SetEquipment(rnByID);
         }
         ProjectSingleton.CurrentProject.NeedPromptSave = true;
         NERelayNodeEventArgs e = new NERelayNodeEventArgs(oldNames, modRelayNodeList);
         this.OnRelayNodeModified(sender, e);
     }
 }
Ejemplo n.º 5
0
 public virtual void OnRelayNodeModified(object sender, NERelayNodeEventArgs e)
 {
     EventHandler<NERelayNodeEventArgs> rnModifyEvent = this.RNModifyEvent;
     if (rnModifyEvent != null)
     {
         rnModifyEvent(sender, e);
     }
 }
Ejemplo n.º 6
0
 public virtual void OnRelayNodeDelete(object sender, NERelayNodeEventArgs e)
 {
     EventHandler<NERelayNodeEventArgs> rnDeleteEvent = this.RNDeleteEvent;
     if (rnDeleteEvent != null)
     {
         rnDeleteEvent(sender, e);
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// DeleteRN内已经绑定好DeleteRelayCell的方法
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="rnList"></param>
 public void DeleteRN(object sender, List<RelayNode> rnList)
 {
     List<string> oldNames = new List<string>();
     List<RelayCell> rcList = new List<RelayCell>();
     foreach (RelayNode rn in rnList)
     {
         oldNames.Add(rn.Name);
         this.m_RNList.Remove(rn);
         rn.Parent.RNList.Remove(rn);
         rcList.AddRange(rn.RCList);
     }  
     m_CollectionModel.RCCOll.DeleteRC(sender, rcList);
     ProjectSingleton.CurrentProject.NeedPromptSave = true;
     NERelayNodeEventArgs e = new NERelayNodeEventArgs(oldNames, rnList);
     this.OnRelayNodeDelete(sender, e);
 }
Ejemplo n.º 8
0
        //已验证,用不到
        //private void SetEquipment(RelayNode rn)
        //{
        //    if (rn.Equipment != null)
        //    {
        //        rn.Equipment = this.m_CollecitonModel.BtsEquipColl.FindBtsEquipmentById(rn.Equipment.ID);
        //    }
        //}

        private void OnRelayNodeAdd(object sender, NERelayNodeEventArgs e)
        {
            EventHandler<NERelayNodeEventArgs> rnAddEvent = this.RNAddEvent;
            if (rnAddEvent != null)
            {
                rnAddEvent(sender, e);
            }
        }
Ejemplo n.º 9
0
 private void RNCol_ModifyEvent(object sender, NERelayNodeEventArgs e)
 {
     if (sender.ToString() != "GIS")
     {
         GeoSiteEventArgs args = new GeoSiteEventArgs();
         foreach (RelayNode relayNode in e.RelayNode)
         {
             args.RelayNodes.Add(RelayNode.GetGeoNESite(relayNode));
             //RelayNode并没有tranceiver需要和它一起移动
             //List<Transceiver> tranceiversOfSite = this.m_TranceiverCol.GetTranceiversOfSite(site);
             //List<Transceiver> list2 = new List<Transceiver>();
             //foreach (Transceiver transceiver in tranceiversOfSite)
             //{
             //    list2.Add(transceiver);
             //}
             //foreach (Transceiver transceiver2 in list2)
             //{
             //    transceiver2.X = site.X + transceiver2.DeltaX;
             //    transceiver2.Y = site.Y + transceiver2.DeltaY;
             //    GeoCell item = new GeoCell();
             //    item = Transceiver.GetGeoNECell(transceiver2);
             //    args.TranceiverList.Add(item);
             //}
         }
         args.argSender = sender;
         if (this.m_GeoMsgChange != null)
         {
             this.m_GeoMsgChange.ModifyRelayNodeMsgChange(args);
             this.m_GeoMsgChange.MapRedraw();
         }
     }
 }
Ejemplo n.º 10
0
 private void RNCol_DeleteEvent(object sender, NERelayNodeEventArgs e)
 {
     if (sender.ToString() != "GIS")
     {
         GeoSiteEventArgs args = new GeoSiteEventArgs();
         foreach (RelayNode relayNode in e.RelayNode)
         {
             args.RelayNodes.Add(RelayNode.GetGeoNESite(relayNode));
         }
         if (this.m_GeoMsgChange != null)
         {
             this.m_GeoMsgChange.DeleteRelayMsgChange(args);
             this.m_GeoMsgChange.MapRedraw();
         }
     }
 }