private void tree_Stipulate_NodeMouseDoubleClick_1(object sender, TreeNodeMouseClickEventArgs e) { if (e.Node.Name == "root") { return; } try { ITerrainDynamicObject61 itdo = (ITerrainDynamicObject61)e.Node.Tag; // ITerrainDynamicObject6 itdo1 = itdo; itdo.RestartRoute(0); string tempName = Program.TE.GetTerraObjectID(itdo.TreeItem.ItemID); if (true) { itdo.Action.Code = ActionCode.AC_FLYTO; Program.TE.SelectItem(itdo.TreeItem.ItemID, 0, 0); Program.TE.Invoke((int)InvokeNumber.BehindObject); } else { Program.TE.FlyToObject(tempName, ActionCode.AC_FLYTO); } } catch (Exception) { } }
public override void OnClick() { try { int groupid = Program.TE.FindItem("fly"); if (groupid >= 0) { int childId = Program.sgworld.ProjectTree.GetNextItem(groupid, ItemCode.CHILD); //if (Currentitdo == -1) //{ while (childId != 0) { ITerrainDynamicObject61 itdo = (ITerrainDynamicObject61)Program.sgworld.ProjectTree.GetObject(childId); if (itdo.Pause == false) { itdo.Pause = true; //Currentitdo = itdo.TreeItem.ItemID; } childId = Program.sgworld.ProjectTree.GetNextItem(childId, ItemCode.NEXT); } //} } } catch { MessageBox.Show("发生错误!"); } }
/// <summary> /// 删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void 除ToolStripMenuItem_Click(object sender, EventArgs e) { try { ITerrainDynamicObject61 itdo = (ITerrainDynamicObject61)tn.Tag; Program.TE.DeleteItem(itdo.TreeItem.ItemID); tree_Stipulate.Nodes.Remove(tn); } catch (Exception) { } }
private void FlyParam_Click(object sender, EventArgs e) { if (this.tree_Stipulate.SelectedNode!=null) { itdo1 = (ITerrainDynamicObject61)this.tree_Stipulate.SelectedNode.Tag; } if (itdo1 == null) { return; } FrmSetPlaneParam pSetPlaneParam = new FrmSetPlaneParam(); pSetPlaneParam.GetDynamicObject = itdo1; pSetPlaneParam.ShowDialog(); }
private void 参数设置ToolStripMenuItem_Click(object sender, EventArgs e) { if (this.tree_Stipulate.SelectedNode != null) { itdo1 = (ITerrainDynamicObject61)this.tree_Stipulate.SelectedNode.Tag; } if (itdo1 == null) { return; } FrmSetPlaneParam pSetPlaneParam = new FrmSetPlaneParam(); pSetPlaneParam.GetDynamicObject = itdo1; pSetPlaneParam.ShowDialog(); }
/// <summary> /// 数据初始化 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FrmStipulatePath_Load(object sender, EventArgs e) { //this.dt = new DataTable(); //DataColumn dcOID = new DataColumn("KEYID", Type.GetType("System.Int32")); //DataColumn dcParentOID = new DataColumn("ParentID", Type.GetType("System.Int32")); //DataColumn dcNodeName = new DataColumn("NodeName", Type.GetType("System.String")); //dt.Columns.Add(dcOID); //dt.Columns.Add(dcParentOID); //dt.Columns.Add(dcNodeName); try { base.FrmName = "规定路径"; //获取飞行浏览信息树文件组 int groupid = Program.TE.FindItem("fly"); int childId = Program.sgworld.ProjectTree.GetNextItem(groupid, ItemCode.CHILD); while (childId != 0) { ITerrainDynamicObject61 itdo = (ITerrainDynamicObject61)Program.sgworld.ProjectTree.GetObject(childId); TreeNode tn = new TreeNode(itdo.TreeItem.Name); tn.Tag = itdo; tn.ImageIndex = 0; this.tree_Stipulate.Nodes[0].Nodes.Add(tn); childId = Program.sgworld.ProjectTree.GetNextItem(childId, ItemCode.NEXT); } this.tree_Stipulate.ExpandAll(); } catch (Exception ex) { // throw; } }
private void tree_Stipulate_NodeMouseDoubleClick_1(object sender, TreeNodeMouseClickEventArgs e) { if (e.Node.Name =="root") { return; } try { ITerrainDynamicObject61 itdo = (ITerrainDynamicObject61)e.Node.Tag; // ITerrainDynamicObject6 itdo1 = itdo; itdo.RestartRoute(0); string tempName = Program.TE.GetTerraObjectID(itdo.TreeItem.ItemID); if (true) { itdo.Action.Code = ActionCode.AC_FLYTO; Program.TE.SelectItem(itdo.TreeItem.ItemID, 0, 0); Program.TE.Invoke((int)InvokeNumber.BehindObject); } else { Program.TE.FlyToObject(tempName, ActionCode.AC_FLYTO); } } catch (Exception) { } }