Exemple #1
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            try
            {
                dynamicObj.Pause = true;

                dynamicObj.Shadow.Show = true;

                dynamicObj.TurnSpeed     = Convert.ToDouble(this.spinEdit1.EditValue);
                dynamicObj.SaveInFlyFile = true;
                if (this.Model)
                {
                    DynamicMotionStyle MotionStyle = this.dynamicObj.MotionStyle;
                    switch (MotionStyle)
                    {
                    case DynamicMotionStyle.MOTION_AIRPLANE:
                        //textEdit2.Text = "80";

                        this.dynamicObj.FileName    = Application.StartupPath + @"\data\plane1.xpc";
                        this.dynamicObj.ScaleFactor = Convert.ToDouble(this.spinEdit3.EditValue);
                        break;

                    case DynamicMotionStyle.MOTION_GROUND_VEHICLE:
                        this.dynamicObj.ScaleFactor = Convert.ToDouble(this.spinEdit3.EditValue);
                        this.dynamicObj.FileName    = Application.StartupPath + @"\data\nissan.xpc";
                        break;

                    case DynamicMotionStyle.MOTION_HELICOPTER:
                        this.dynamicObj.ScaleFactor = Convert.ToDouble(this.spinEdit3.EditValue);
                        this.dynamicObj.FileName    = Application.StartupPath + @"\data\hel1.xpc";
                        // textEdit2.Text = "50";
                        break;

                    case DynamicMotionStyle.MOTION_HOVER:
                        this.dynamicObj.FileName = "";
                        break;

                    default:
                        break;
                    }
                    Program.TE.SelectItem(dynamicObj.TreeItem.ItemID, 0, 0);
                    dynamicObj.Pause = false;
                }
                int waypointCount = this.pRouteWaypoints61.Count;
                for (int i = 0; i < waypointCount; i++)
                {
                    IRouteWaypoint61 pRouteWaypoint = this.pRouteWaypoints61[i] as IRouteWaypoint61;
                    pRouteWaypoint.Speed    = Convert.ToDouble(this.spinEdit2.EditValue);
                    pRouteWaypoint.Altitude = Convert.ToDouble(this.spinEdit4.Value);
                }
            }
            catch (Exception)
            {
            }
        }
Exemple #2
0
        private void FrmSetPlaneParam_Load(object sender, EventArgs e)
        {
            //this.comboBoxEdit2.SelectedIndex = 0;
            //this.comboBoxEdit3.SelectedIndex = 0;
            try
            {
                //相对高度

                _Position61       = dynamicObj.Position;
                pRouteWaypoints61 = dynamicObj.Waypoints;//路点
                IRouteWaypoint61 pRouteWaypoint = this.pRouteWaypoints61[0] as IRouteWaypoint61;
                spinEdit2.Value      = Convert.ToDecimal(pRouteWaypoint.Speed);
                spinEdit1.Value      = Convert.ToDecimal(dynamicObj.TurnSpeed);
                this.spinEdit4.Value = Convert.ToDecimal(pRouteWaypoint.Altitude);
                if (this.dynamicObj.DynamicType == DynamicObjectType.DYNAMIC_VIRTUAL)
                {
                    this.comboBoxEdit2.SelectedIndex = 0;
                    this.Model            = false;
                    comboBoxEdit3.Enabled = false;
                }
                else
                {
                    this.comboBoxEdit2.SelectedIndex = 1;
                    this.Model            = true;
                    comboBoxEdit3.Enabled = true;
                }

                if (this.dynamicObj.MotionStyle == DynamicMotionStyle.MOTION_AIRPLANE)
                {
                    this.comboBoxEdit3.SelectedIndex = 1;
                }
                else if (this.dynamicObj.MotionStyle == DynamicMotionStyle.MOTION_HELICOPTER)
                {
                    this.comboBoxEdit3.SelectedIndex = 2;
                }
                else if (this.dynamicObj.MotionStyle == DynamicMotionStyle.MOTION_GROUND_VEHICLE)
                {
                    this.comboBoxEdit3.SelectedIndex = 0;
                }
            }
            catch (Exception)
            {
            }
        }