Exemple #1
0
        private async void btn_reserve_section_Click(object sender, EventArgs e)
        {
            string vh_id  = cmb_vh_ids.Text;
            string sec_id = cmb_reserve_section.Text.Trim();

            Mirle.Hlts.Utils.HltDirection fork_dir;
            Enum.TryParse <Mirle.Hlts.Utils.HltDirection>(cmb_fork_dir.SelectedValue.ToString(), out fork_dir);
            Mirle.Hlts.Utils.HltDirection sensor_dir;
            Enum.TryParse <Mirle.Hlts.Utils.HltDirection>(cmb_sensor_dir.SelectedValue.ToString(), out sensor_dir);

            Mirle.Hlts.Utils.HltResult result = null;
            await Task.Run(() => result = bcApp.SCApplication.ReserveBLL.TryAddReservedSection(vh_id, sec_id, sensor_dir, fork_dir));

            MessageBox.Show(result.ToString());
            RefreshReserveInfo();
        }
Exemple #2
0
        private async void btn_set_vh_Click(object sender, EventArgs e)
        {
            string adr_id           = cmb_adr_id.Text;
            string vh_id            = cmb_vh_ids.Text;
            var    map_address_axis = bcApp.SCApplication.ReserveBLL.GetHltMapAddress(adr_id);

            Mirle.Hlts.Utils.HltDirection vh_fork_dir;
            Enum.TryParse <Mirle.Hlts.Utils.HltDirection>(cmb_vh_fork_dir.SelectedValue.ToString(), out vh_fork_dir);
            Mirle.Hlts.Utils.HltDirection vh_sensor_dir;
            Enum.TryParse <Mirle.Hlts.Utils.HltDirection>(cmb_vh_sensor_dir.SelectedValue.ToString(), out vh_sensor_dir);

            Mirle.Hlts.Utils.HltResult result = null;
            await Task.Run(() => result = bcApp.SCApplication.ReserveBLL.TryAddVehicleOrUpdate(vh_id, "", map_address_axis.x, map_address_axis.y, 0, 0, vh_sensor_dir, vh_fork_dir));

            MessageBox.Show(result.ToString());
            RefreshReserveInfo();
        }
        private async void btn_set_vh_by_axis_Click(object sender, EventArgs e)
        {
            string vh_id  = cmb_vh_ids.Text;
            string x_axis = txt_x.Text;
            string y_axis = txt_y.Text;

            double.TryParse(x_axis, out double x);
            double.TryParse(y_axis, out double y);
            Mirle.Hlts.Utils.HltDirection vh_fork_dir;
            Enum.TryParse <Mirle.Hlts.Utils.HltDirection>(cmb_vh_fork_dir.SelectedValue.ToString(), out vh_fork_dir);
            Mirle.Hlts.Utils.HltDirection vh_sensor_dir;
            Enum.TryParse <Mirle.Hlts.Utils.HltDirection>(cmb_vh_sensor_dir.SelectedValue.ToString(), out vh_sensor_dir);

            Mirle.Hlts.Utils.HltResult result = null;
            await Task.Run(() => result = bcApp.SCApplication.ReserveBLL.TryAddVehicleOrUpdate(vh_id, "", x, y, 0, 0, vh_sensor_dir, vh_fork_dir));

            MessageBox.Show(result.ToString());
        }