コード例 #1
0
 public DialogEditWP(Waypoint_Path_Gen wpg, GMAP gmap, int path_index, int wp_index)
 {
     _wpg      = wpg;
     _gmap     = gmap;
     _wp_index = wp_index;
     _path     = _wpg.PathAt(path_index);
     _wp_list  = _path.waypoints;
     _wp       = _wp_list.ElementAt(wp_index);
     InitializeComponent();
     txtWPIndex.Text        = Convert.ToString(wp_index);
     txtwplat.Text          = Convert.ToString(_wp.lat);
     txtwplon.Text          = Convert.ToString(_wp.lon);
     txtwpalt.Text          = Convert.ToString(_wp.alt);
     txtwphead.Text         = Convert.ToString(_wp.head);
     txtwpcurvesize.Text    = Convert.ToString(_wp.curvesize);
     txtwprotdirection.Text = Convert.ToString(_wp.rotationdir);
     txtwpgimblemode.Text   = Convert.ToString(_wp.gimblemode);
     txtgimblepitch.Text    = Convert.ToString(_wp.gimblepitch);
     trkHeading.Value       = Convert.ToInt16(_wp.head);
     trkCurveSize.Value     = Convert.ToInt16(_wp.curvesize);
     for (int i = 0; i < _wpg.ActionCount(); i++)
     {
         cmbActions.Items.Add(_wpg.ActionAt(i).name);
     }
     cmbActions.SelectedIndex = 0;
 }
コード例 #2
0
        private void btnAccept_Click(object sender, EventArgs e)
        {
            _wp.alt         = Convert.ToDouble(txtwpalt.Text);
            _wp.head        = Convert.ToDouble(txtwphead.Text);
            _wp.curvesize   = Convert.ToDouble(txtwpcurvesize.Text);
            _wp.rotationdir = Convert.ToDouble(txtwprotdirection.Text);
            _wp.gimblemode  = Convert.ToInt16(txtwpgimblemode.Text);
            _wp.gimblepitch = Convert.ToDouble(txtgimblepitch.Text);
            int action_id = cmbActions.SelectedIndex;

            Models.Action action = _wpg.ActionAt(action_id);
            string        name   = action.name;

            int[,] actions = action.actions;
            _wp.actions    = actions;
            _gmap.ReDrawgMap();
            this.Close();
        }
コード例 #3
0
        private void Update_Actioncmb()
        {
            int count = _wpg.ActionCount();

            Models.Action action;
            string        name;

            cmbActionsWaypoints.Items.Clear();

            for (int i = 0; i < count; i++)
            {
                action = _wpg.ActionAt(i);
                name   = action.name;

                cmbActionsWaypoints.Items.Add(name);
            }
            //cmbActionsList.SelectedIndex = 0;
        }
コード例 #4
0
        private void cmbActionsList_SelectedIndexChanged(object sender, EventArgs e)
        {
            int index = cmbActionsList.SelectedIndex;

            Models.Action action = _wpg.ActionAt(index);
            string        name   = action.name;

            int[,] actions        = action.actions;
            txtNewActionName.Text = name;
            txtActionID.Text      = Convert.ToString(action.internal_id);

            cmbAction1.SelectedIndex  = actions[0, 0] + 1;
            txtActionParam1.Text      = Convert.ToString(actions[0, 1]);
            cmbAction2.SelectedIndex  = actions[1, 0] + 1;
            txtActionParam2.Text      = Convert.ToString(actions[1, 1]);
            cmbAction3.SelectedIndex  = actions[2, 0] + 1;
            txtActionParam3.Text      = Convert.ToString(actions[2, 1]);
            cmbAction4.SelectedIndex  = actions[3, 0] + 1;
            txtActionParam4.Text      = Convert.ToString(actions[3, 1]);
            cmbAction5.SelectedIndex  = actions[4, 0] + 1;
            txtActionParam5.Text      = Convert.ToString(actions[4, 1]);
            cmbAction6.SelectedIndex  = actions[5, 0] + 1;
            txtActionParam6.Text      = Convert.ToString(actions[5, 1]);
            cmbAction7.SelectedIndex  = actions[6, 0] + 1;
            txtActionParam7.Text      = Convert.ToString(actions[6, 1]);
            cmbAction8.SelectedIndex  = actions[7, 0] + 1;
            txtActionParam8.Text      = Convert.ToString(actions[7, 1]);
            cmbAction9.SelectedIndex  = actions[8, 0] + 1;
            txtActionParam9.Text      = Convert.ToString(actions[8, 1]);
            cmbAction10.SelectedIndex = actions[9, 0] + 1;
            txtActionParam10.Text     = Convert.ToString(actions[9, 1]);
            cmbAction11.SelectedIndex = actions[10, 0] + 1;
            txtActionParam11.Text     = Convert.ToString(actions[10, 1]);
            cmbAction12.SelectedIndex = actions[11, 0] + 1;
            txtActionParam12.Text     = Convert.ToString(actions[11, 1]);
            cmbAction13.SelectedIndex = actions[12, 0] + 1;
            txtActionParam13.Text     = Convert.ToString(actions[12, 1]);
            cmbAction14.SelectedIndex = actions[13, 0] + 1;
            txtActionParam14.Text     = Convert.ToString(actions[13, 1]);
            cmbAction15.SelectedIndex = actions[14, 0] + 1;
            txtActionParam15.Text     = Convert.ToString(actions[14, 1]);
        }
コード例 #5
0
        public DialogActions(Waypoint_Path_Gen wpg)
        {
            _wpg = wpg;
            InitializeComponent();
            int count = _wpg.ActionCount();

            Models.Action action;
            string        name;

            cmbActionsList.Items.Clear();
            //cmbActionsWaypoints.Items.Clear();

            for (int i = 0; i < count; i++)
            {
                action = _wpg.ActionAt(i);
                name   = action.name;

                cmbActionsList.Items.Add(name);
                //cmbActionsWaypoints.Items.Add(name);
            }

            txtNewActionName.Text     = "";
            cmbAction1.SelectedIndex  = 0;
            cmbAction2.SelectedIndex  = 0;
            cmbAction3.SelectedIndex  = 0;
            cmbAction4.SelectedIndex  = 0;
            cmbAction5.SelectedIndex  = 0;
            cmbAction6.SelectedIndex  = 0;
            cmbAction7.SelectedIndex  = 0;
            cmbAction8.SelectedIndex  = 0;
            cmbAction9.SelectedIndex  = 0;
            cmbAction10.SelectedIndex = 0;
            cmbAction11.SelectedIndex = 0;
            cmbAction12.SelectedIndex = 0;
            cmbAction13.SelectedIndex = 0;
            cmbAction14.SelectedIndex = 0;
            cmbAction15.SelectedIndex = 0;
            txtActionParam1.Text      = "-1";
            txtActionParam2.Text      = "-1";
            txtActionParam3.Text      = "-1";
            txtActionParam4.Text      = "-1";
            txtActionParam5.Text      = "-1";
            txtActionParam6.Text      = "-1";
            txtActionParam7.Text      = "-1";
            txtActionParam8.Text      = "-1";
            txtActionParam9.Text      = "-1";
            txtActionParam10.Text     = "-1";
            txtActionParam11.Text     = "-1";
            txtActionParam12.Text     = "-1";
            txtActionParam13.Text     = "-1";
            txtActionParam14.Text     = "-1";
            txtActionParam15.Text     = "-1";
        }