示例#1
0
        /// <param name="catalog"></param>
        /// <returns></returns>
        private string GenralReportInfos(ICatalogItem catalog)
        {
            MonitorProductInfo info = new MonitorProductInfo();

            //fir ,fog
            info.productType = catalog.Info.GetPropertyValue("ProductIdentify");
            //tjcp:统计产品  xxcp;信息列表  sgcp:栅格产品 ztcp:专题产品   slcp:矢量产品 dhcp:动画产品
            info.productDataType     = catalog.Info.GetPropertyValue("CatalogDef");         //VectorProduct、
            info.productIdentify     = catalog.Info.GetPropertyValue("SubProductIdentify"); //DBLV,0CSR,"PLST";
            info.productIdentifyName = catalog.Info.GetPropertyValue("CatalogItemCN");      //"火点二值图";
            info.satellite           = catalog.Info.GetPropertyValue("Satellite");
            info.sensor         = catalog.Info.GetPropertyValue("Sensor");
            info.subProductType = "";                                                   //通常为空
            info.orbitDateTime  = DateTime.Parse(catalog.Info.GetPropertyValue("OrbitDateTime"));
            info.productArea    = catalog.Info.GetPropertyValue("Region");
            string dir = "\\" + dateTimePicker1.Value.ToString("yyyyMMdd") + "\\" + cbSubFolder.Text;

            if (catalog.Info.Properties.ContainsKey(CatalogTreeView.ToReportInfoKey))
            {
                catalog.Info.Properties[CatalogTreeView.ToReportInfoKey] = CatalogTreeView.ToReportInfoValue;
            }
            else
            {
                catalog.Info.Properties.Add(CatalogTreeView.ToReportInfoKey, CatalogTreeView.ToReportInfoValue);
            }
            string infoFilename = System.IO.Path.ChangeExtension(catalog.FileName, ".info");

            catalog.Info.SaveTo(infoFilename);
            CopyFile(dir, catalog.FileName);
            string productFilename = System.IO.Path.GetFileName(catalog.FileName);

            info.productFileName = productFilename;
            info.productFilePath = dir;
            return(dir);
        }
示例#2
0
        private void btnToDb_Click(object sender, EventArgs e)
        {
            try
            {
                btnToDb.Enabled = false;
                if (_catalogTreeView == null)
                {
                    MsgBox.ShowInfo("没有数据");
                    return;
                }
                Dictionary <string, List <ICatalogItem> > catalogItems = _catalogTreeView.GetCheckedItem();
                if (catalogItems == null || catalogItems.Count == 0)
                {
                    MsgBox.ShowInfo("没有数据");
                    return;
                }
                OnProgress(0);
                string dir = string.Empty;
                foreach (string key in catalogItems.Keys)
                {
                    List <ICatalogItem> items = catalogItems[key];
                    for (int i = 0; i < items.Count; i++)
                    {
                        OnProgress((int)((i + 1.0) / items.Count));
                        dir = GenralReportInfos(items[i]);
                    }
                }

                MonitorProductInfo info = new MonitorProductInfo();
                //
                SaveToDb(null, info, dir);
                OnSendMessage("完成报告素材提交");
                MsgBox.ShowInfo("完成报告素材提交");
            }
            catch (Exception ex)
            {
                OnSendMessage(ex.Message);
                MsgBox.ShowInfo(ex.Message);
            }
            finally
            {
                LoadData();
                btnToDb.Enabled = true;
                OnProgress(0);
            }
        }
示例#3
0
        private void SaveToDb(string key, MonitorProductInfo info, string dir)
        {
            CopyQuickReportArgsFile(_reportPath + dir);
            string toDBConsole = AppDomain.CurrentDomain.BaseDirectory + @"\SystemData\Report\GeoDo.Mms.Tools.InfosCollectionDemo.exe";

            if (File.Exists(toDBConsole))
            {
                System.Diagnostics.Process exep = new System.Diagnostics.Process();
                exep.StartInfo                        = new System.Diagnostics.ProcessStartInfo(toDBConsole);
                exep.StartInfo.Arguments              = _reportPath + dir + " " + QuickReportXML.tempQuickReportXML; //设定参数
                exep.StartInfo.UseShellExecute        = false;                                                       //不使用系统外壳程序启动
                exep.StartInfo.RedirectStandardInput  = false;                                                       //不重定向输入
                exep.StartInfo.RedirectStandardOutput = true;                                                        //重定向输出,而不是默认的显示在dos控制台上
                exep.StartInfo.CreateNoWindow         = true;                                                        //不创建窗口
                exep.Start();
                exep.WaitForExit();
                exep.Close();
            }
        }