Exemplo n.º 1
0
 private void SendMessage(string obj)
 {
     try
     {
         if (obj != null && obj.Length != 0)
         {
             int ind = obj.IndexOf("\r\n");
             if (ind > 0)
             {
                 obj = obj.Substring(0, ind);
             }
         }
         if (this.InvokeRequired)
         {
             this.Invoke(new Action <string>((val) => { this.lbMessage.Text = val; }), obj);
         }
         else
         {
             this.lbMessage.Text = obj;
         }
     }
     catch (Exception ex)
     {
         LogFactory.WriteLine("queryPageControl:OnMessageSend:" + ex.Message);
     }
 }
Exemplo n.º 2
0
 public void StopListen()
 {
     try
     {
         if (_isWorkering)
         {
             source.Cancel();
         }
         if (!isStarting)
         {
             return;
         }
         isStarting = false;
         scTimer.Dispose();
     }
     catch (Exception ex)
     {
         LogFactory.WriteLine("StopListen:" + ex.Message);
         _listenEnception = ex;
         if (ThreadExceptionEventHandler != null)
         {
             ThreadExceptionEventHandler(this, new ThreadExceptionEventArgs(ex));
         }
     }
 }
Exemplo n.º 3
0
 void _hdDataMonitor_MessageSend(string obj)
 {
     try
     {
         if (obj != null && obj.Length != 0)
         {
             int ind = obj.IndexOf("\r\n");
             if (ind > 0)
             {
                 obj = obj.Substring(0, ind);
             }
         }
         if (this.InvokeRequired)
         {
             this.Invoke(new Action <string>((val) => { this.toolStripStatusLabel3.Text = val; }), obj);
         }
         else
         {
             this.toolStripStatusLabel3.Text = obj;
         }
     }
     catch (Exception ex)
     {
         LogFactory.WriteLine("_hdDataMonitor_MessageSend:" + ex.Message);
     }
 }
Exemplo n.º 4
0
 private void FilterBitMap()
 {
     _filter = dataFileterControl1.CheckedFilter;
     try
     {
         _simpleMapControl.RemoveAllImageLayers();
         for (int i = 0; i < _lstOverviews.Count; i++)
         {
             ProjectionInfo pInfo = _lstOverviews[i].ProjectionInfo;
             if (pInfo.orbitInfo.dayOrNight == "D")
             {
                 if (this.InvokeRequired)
                 {
                     this.Invoke(new Action <OverViewObject>(AddOverView), _lstOverviews[i]);
                 }
                 else
                 {
                     AddOverView(_lstOverviews[i]);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         LogFactory.WriteLine("FilterBitMap:" + ex.Message);
     }
     finally
     {
     }
 }
Exemplo n.º 5
0
 private static Bitmap LoadImage(string filePath)
 {
     try
     {
         Bitmap bmp;
         using (Bitmap load = new Bitmap(filePath))
         {
             int max = Math.Max(load.Width, load.Height);
             if (_maxImgSize >= max)
             {
                 bmp = new Bitmap(load, load.Width, load.Height);
             }
             else
             {
                 double sc = _maxImgSize * 1.0f / max;
                 bmp = new Bitmap(load, (int)(load.Width * sc), (int)(load.Height * sc));
             }
         }
         return(bmp);
     }
     catch (Exception ex)
     {
         LogFactory.WriteLine("LoadImage:" + ex.Message);
         return(null);
     }
 }
Exemplo n.º 6
0
 private void getMosaicsAsync()
 {
     try
     {
         _dbProvider.getMosaicsAsync(_monitBeginTime, _monitEndTime);
     }
     catch (Exception ex)
     {
         LogFactory.WriteLine("getMosaicsAsync:" + ex.Message);
     }
 }
Exemplo n.º 7
0
 private void UpdateBlockInfo()
 {
     try
     {
         lbBlock.Text = string.Format(" 截止{0}共收到分幅数据 {1}条", dtSearchTime.Value.ToShortDateString() == DateTime.Now.ToShortDateString() ? DateTime.Now.ToString("HH:mm:ss") : "23:59:59", _recivedBlocks.Count);
         notifyRadioButtonBlock.NotifyMessage = _recivedBlocks.Count;
         FilterBlockView();
     }
     catch (Exception ex)
     {
         LogFactory.WriteLine("UpdateBlockInfo:" + ex.Message);
     }
 }
Exemplo n.º 8
0
 private void FilterMosaic()
 {
     try
     {
     }
     catch (Exception ex)
     {
         LogFactory.WriteLine("FilterMosaic:" + ex.Message);
     }
     finally
     {
     }
 }
Exemplo n.º 9
0
 private void UpdateMosaicInfo()
 {
     try
     {
         lbMosaic.Text = string.Format(" 截止{0}共收到拼接数据 {1}条", dtSearchTime.Value.ToShortDateString() == DateTime.Now.ToShortDateString() ? DateTime.Now.ToString("HH:mm:ss") : "23:59:59", _lstMosaicInfo.Count);
         notifyRadioButtonMosaic.NotifyMessage = _lstMosaicInfo.Count;
         FilterMosaic();
     }
     catch (Exception ex)
     {
         LogFactory.WriteLine("UpdateMosaicInfo:" + ex.Message);
     }
 }
Exemplo n.º 10
0
 void _client_getMosaicsCompleted(object sender, HdDataServer.getMosaicsCompletedEventArgs e)
 {
     try
     {
         if (getMosaicsCompleted != null)
         {
             getMosaicsCompleted(sender, e);
         }
     }
     catch (Exception ex)
     {
         LogFactory.WriteLine("_client_getMosaicsCompleted:" + ex.Message);
     }
 }
Exemplo n.º 11
0
 private void UpdateProjectionInfo()
 {
     try
     {
         this.lbFiveMini.Text = string.Format(" 截止{0}共收到轨道数据 {1}条", dtSearchTime.Value.ToShortDateString() == DateTime.Now.ToShortDateString() ? DateTime.Now.ToString("HH:mm:ss") : "23:59:59", _lstOverviews.Count);
         notifyRadioButtonProjection.NotifyMessage = _lstOverviews.Count;
         FilterBitMap();
         _simpleMapControl.Render();
     }
     catch (Exception ex)
     {
         LogFactory.WriteLine("UpdateProjectionInfo:" + ex.Message);
     }
 }
Exemplo n.º 12
0
 void tasks_ThreadExceptionEventHandler(object sender, System.Threading.ThreadExceptionEventArgs e)
 {
     try
     {
         if (e.Exception != null)
         {
             OnMessageSend(e.Exception.Message);
         }
     }
     catch (Exception ex)
     {
         LogFactory.WriteLine("getBlocksAsync:" + ex.Message);
     }
 }
Exemplo n.º 13
0
 public HdDataProvider()
 {
     try
     {
         _client = new HdDataServer.DataSearchServerPortTypeClient();
         _client.getProjectionsCompleted += new EventHandler <HdDataServer.getProjectionsCompletedEventArgs>(_client_getProjectionsCompleted);
         _client.getMosaicsCompleted     += new EventHandler <HdDataServer.getMosaicsCompletedEventArgs>(_client_getMosaicsCompleted);
         _client.getBlocksCompleted      += new EventHandler <HdDataServer.getBlocksCompletedEventArgs>(_client_getBlocksCompleted);
         _client.getRasterDatsCompleted  += new EventHandler <HdDataServer.getRasterDatsCompletedEventArgs>(_client_getRasterDatsCompleted);
         _client.Open();
         _canUse = true;
     }
     catch (Exception ex)
     {
         _canUse = false;
         LogFactory.WriteLine("创建实例失败" + ex.Message);
     }
 }
Exemplo n.º 14
0
 private void ListenWorker(object obj)
 {
     try
     {
         if (!isStarting || _isWorkering)
         {
             return;
         }
         _isWorkering = true;
         //Task workerTask = new Task(() => { TaskWorker(); });
         //workerTask.Start(cts);
         source = new CancellationTokenSource();
         var token = source.Token;
         Task.Factory.StartNew(() =>
         {
             TaskWorker();
         }, token)
         .ContinueWith((t) =>
         {
             if (t.Exception == null)
             {
                 return;
             }
             LogFactory.WriteLine("I have observed a " + t.Exception.InnerException.GetType().Name);
             Console.WriteLine("I have observed a {0}", t.Exception.InnerException.GetType().Name);
         }, TaskContinuationOptions.OnlyOnFaulted);
     }
     catch (Exception ex)
     {
         LogFactory.WriteLine("ListenWorker:" + ex.Message);
         _listenEnception = ex;
         if (ThreadExceptionEventHandler != null)
         {
             ThreadExceptionEventHandler(this, new ThreadExceptionEventArgs(ex));
         }
     }
     finally
     {
         _isWorkering = false;
     }
 }
Exemplo n.º 15
0
 void _client_getProjectionsCompleted(object sender, HdDataServer.getProjectionsCompletedEventArgs e)
 {
     try
     {
         if (e.Error == null)
         {
             HdDataServer.ProjectionInfo[] s = e.Result;
             if (e.Result.Length == 0)
             {
                 if (getProjectionsCompleted != null)
                 {
                     getProjectionsCompleted(this, e);
                 }
             }
             else
             {
                 var r = from item in s
                         where !string.IsNullOrWhiteSpace(item.datapath)
                         select item;
                 if (getProjectionsCompleted != null)
                 {
                     getProjectionsCompleted(this, new HdDataServer.getProjectionsCompletedEventArgs(new object[] { r.ToArray() }, e.Error, e.Cancelled, e.UserState));
                 }
             }
         }
         else
         {
             if (getProjectionsCompleted != null)
             {
                 getProjectionsCompleted(this, e);
             }
         }
     }
     catch (Exception ex)
     {
         LogFactory.WriteLine("_client_getProjectionsCompleted:" + ex.Message);
     }
 }
Exemplo n.º 16
0
        private void FilterBlockView()
        {
            try
            {
                ClearAoi(_blockHost);
                string        blockType         = getBlockType();
                List <string> existsBlockEvname = new List <string>();
                for (int i = 0; i < _recivedBlocks.Count; i++)
                {
                    //if (_recivedBlocks[i].BlockInfo.mosaicInfo == null)
                    //{
                    //    toolStripStatusLabel3.Text = string.Format("未获取分幅[{0}]的白天晚上信息,将直接显示", _recivedBlocks[i].Name);
                    //    continue;
                    //}
                    //不显示夜间分块数据
                    //else if (_recivedBlocks[i].BlockInfo.mosaicInfo != null && _recivedBlocks[i].BlockInfo.mosaicInfo.dayOrNight != "D")
                    if (_recivedBlocks[i].BlockInfo.mosaicInfo != null && _recivedBlocks[i].BlockInfo.mosaicInfo.dayOrNight != "D")
                    {
                        continue;
                    }
                    if (_recivedBlocks[i].BlockInfo.mosaicInfo == null && _recivedBlocks[i].BlockInfo.projectionInfo.orbitInfo.dayOrNight != "D")
                    {
                        continue;
                    }
                    if (_recivedBlocks[i].BlockInfo.blockidentify != blockType)
                    {
                        continue;
                    }
                    if (_recivedBlocks[i].Satalite != _filter.Satellite ||
                        _recivedBlocks[i].Sensor != _filter.Sensor)
                    {
                        continue;
                    }
                    if (existsBlockEvname.IndexOf(_recivedBlocks[i].BlockInfo.envname) != -1)
                    {
                        continue;
                    }
                    existsBlockEvname.Add(_recivedBlocks[i].BlockInfo.envname);
                    if (this.InvokeRequired)
                    {
                        this.Invoke(new Action <BlockInfoItem>(AddBlock), _recivedBlocks[i]);
                    }
                    else
                    {
                        AddBlock(_recivedBlocks[i]);
                    }
                }
                _simpleMapControl.Render();
            }
            catch (Exception ex)
            {
                LogFactory.WriteLine("FilterBlock:" + ex.Message);
            }
            finally
            {
            }
            List <BlockInfoItem> itmes = new List <BlockInfoItem>();

            foreach (BlockInfoItem item in _recivedBlocks)
            {
                if (item.BlockInfo.blockidentify == "DBU" || item.BlockInfo.envname == "DBU")
                {
                    item.BlockInfo.envname = "DBU";
                }
            }
        }