コード例 #1
0
        private void ThreadRun()
        {
            ThreadSetBtnEnabel(false);
            frmWait f = new frmWait("正在生成路径请稍候....");

            f.Show();
            f.Refresh();
            string message = dpicbll.ProductRoutePoint(f, f.PgbWait, FileID);

            f.Close();
            MessageBox.Show(message);
            ThreadSetBtnEnabel(true);
            SaveThread.Abort();
        }
コード例 #2
0
 private void ThreadRun()
 {
     ThreadSetBtnEnabel(false);
     frmWait f = new frmWait("正在生成路径请稍候....");
     f.Show();
     f.Refresh();
     string message = dpicbll.ProductRoutePoint(f, f.PgbWait, FileID);
     f.Close();
     //MessageBox.Show(message);
     ThreadSetBtnEnabel(true);
     SaveThread.Abort();
 }
コード例 #3
0
        /// <summary>
        /// 线程运行  生成轨迹
        /// </summary>
        private void ThreadRun()
        {
            try
            {
                string strOutMessage ;
                SetHistoryBtnEnabel(false);
                int step = 100 / EmpMoverList.Count;
                frmWait f = new frmWait("正在生成历史轨迹,请稍候....");
                f.Show();
                if (this.PageIndex == 0)
                {
                    #region[时间选择]
                    foreach (EmpMoverModel emm in EmpMoverList)
                    {
                        f.Refresh();
                        //Czlt-2012-04-20 注销
                        //List<string> list = dpicbll.GetRouteInfoByEmpID(emm.EmpID, dtpStart.Value.ToString("yyyy-MM-dd HH:mm:ss"), dtpEnd.Value.ToString("yyyy-MM-dd HH:mm:ss"), int.Parse(FileID));
                        strOutMessage = string.Empty;
                        List<string> list = dpicbll.GetRouteInfoByEmpID(emm.EmpID, dtpStart.Value.ToString("yyyy-MM-dd HH:mm:ss"), dtpEnd.Value.ToString("yyyy-MM-dd HH:mm:ss"), int.Parse(FileID), out strOutMessage);
                        if (list != null && list.Count >= 5)
                            this.MapGis.AddMover(list[0], list[1], list[2], list[3], list[4], MoverZFilePath, MoverFFilePath, emm.EmpID);
                        else
                            NoRoutePeoples.Add(emm.EmpName);
                        //this.MapGis.SetPaintMover(emm.EmpID);
                        f.PgbWait.Value += step;
                    }
                    if (NoRoutePeoples.Count == 0 && EmpMoverList.Count != 0)
                    {
                        //this.MapGis.StartMoving();
                        //this.btnHistoryRoute.Enabled = false;
                        MapgisStartMoving();
                    }
                    else
                    {
                        if (NoRoutePeoples.Count == EmpMoverList.Count)
                        {
                            MessageBox.Show("选择的人员均没有可播放的历史轨迹!", "提示", MessageBoxButtons.OK);
                            SetHistoryBtnEnabel(true);
                        }
                        else
                        {
                            string message = string.Empty;
                            for (int i = 0; i < NoRoutePeoples.Count; i++)
                            {
                                if (i == 0)
                                    message = NoRoutePeoples[i];
                                else
                                    message = message + "," + NoRoutePeoples[i];
                            }
                            if (message.Length > 0)
                                message.Remove(message.Length - 2);
                            MessageBox.Show(message + "等人员没有可播放的历史轨迹!", "提示", MessageBoxButtons.OK);
                            MapgisStartMoving();
                        }
                    }
                    #endregion
                }
                else
                {
                    #region[班次选择]
                    foreach (EmpMoverModel emm in EmpMoverList)
                    {
                        f.Refresh();
                        //List<string> list = dpicbll.GetRouteInfoByEmpID(emm.EmpID, dtpban.Value.ToString("yyyy-MM-dd 00:00:00"), dtpban.Value.ToString("yyyy-MM-dd 23:59:59"), int.Parse(FileID));

                        strOutMessage = string.Empty;
                        List<string> list = dpicbll.GetRouteInfoByEmpID(emm.EmpID, dtpban.Value.ToString("yyyy-MM-dd 00:00:00"), dtpban.Value.ToString("yyyy-MM-dd 23:59:59"), int.Parse(FileID),out strOutMessage);
                        if (list != null && list.Count >= 5)
                            this.MapGis.AddMover(list[0], list[1], list[2], list[3], list[4], MoverZFilePath, MoverFFilePath, emm.EmpID);
                        else
                            NoRoutePeoples.Add(emm.EmpName);
                        f.PgbWait.Value += step;
                    }
                    if (NoRoutePeoples.Count == 0)
                    {
                        MapgisStartMoving();
                    }
                    else
                    {
                        if (NoRoutePeoples.Count == EmpMoverList.Count)
                        {
                            MessageBox.Show("选择的所有人员均没有可播放的历史轨迹!", "提示", MessageBoxButtons.OK);
                            SetHistoryBtnEnabel(true);
                        }
                        else
                        {
                            string message = string.Empty;
                            foreach (string str in NoRoutePeoples)
                            {
                                message = message + str + ",";
                            }
                            if (message.Length > 0)
                                message.Remove(message.Length - 1);
                            MessageBox.Show(message + "等人员没有可播放的历史轨迹!", "提示", MessageBoxButtons.OK);
                            MapgisStartMoving();
                        }
                    }
                    #endregion
                }
                f.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("历史轨迹生成失败!", "提示", MessageBoxButtons.OK);
                SetHistoryBtnEnabel(true);
            }
            finally
            {
                NoRoutePeoples.Clear();
                System.Threading.Thread.CurrentThread.Abort();
            }
        }