Exemplo n.º 1
0
        public static string GetRootPathFromName(string localfname)
        {
            DataBaseArg dbargs = DataBaseArg.ParseXml(_dataBaseXml);
            //string dir = dbargs.OutputDir;
            string dir = null;

            if (Path.GetDirectoryName(localfname).ToUpper().Contains("MODIS"))
            {
                dir = dbargs.OutputDir;
            }
            else if (Path.GetDirectoryName(localfname).ToUpper().Contains("AIRS"))
            {
                dir = dbargs.AIRSRootPath;
            }
            else if (Path.GetDirectoryName(localfname).ToUpper().Contains("ISCCP"))
            {
                dir = dbargs.ISCCPRootPath;
            }
            else if (Path.GetDirectoryName(localfname).ToUpper().Contains("CLOUDSAT"))
            {
                dir = dbargs.CloudSATRootPath;
            }
            else
            {
                dir = dbargs.OutputDir;
            }
            return(dir);
        }
Exemplo n.º 2
0
 private void InitSetting()
 {
     cbxPrdsLevl.Items.Add("原始产品数据");
     //cbxPrdsLevl.Items.Add("历史日拼接数据");
     //cbxPrdsLevl.Items.Add("周期合成产品数据");
     //checkbxMODIS.Checked = true;
     cbxPrdsLevl.SelectedIndex = 0;
     if (!File.Exists(_dataBaseXml))
     {
         MessageBox.Show("数据库配置文件不存在,请先配置数据库!");
         return;
     }
     arg = DataBaseArg.ParseXml(_dataBaseXml);
     //txtDocDir.Text = arg.OutputDir;
 }
Exemplo n.º 3
0
 public void TryParseXmlArgs()
 {
     if (File.Exists(_dataBaseXml))
     {
         DataBaseArg arg = DataBaseArg.ParseXml(_dataBaseXml);
         txtserver.Text        = arg.ServerName;
         txtDatabase.Text      = arg.DatabaseName;
         txtAccount.Text       = arg.UID;
         txtpassword.Text      = arg.Passwords;
         MODISRootPath.Text    = arg.OutputDir;
         AIRSRootPath.Text     = arg.AIRSRootPath;
         ISCCPRootPath.Text    = arg.ISCCPRootPath;
         CloudSATRootPath.Text = arg.CloudSATRootPath;
     }
 }
Exemplo n.º 4
0
 private void InitSetting()
 {
     _data2DBTable.Add("ISCCP", "cp_isccpd2_tb");
     _data2DBTable.Add("MODIS", "cp_modismod06_tb");
     _data2DBTable.Add("AIRS", "cp_airs_tb");
     _data2DBTable.Add("CLOUDSAT", "cp_cloudsat_tb");
     _data2DBTable.Add("日拼接产品", "cp_daymergeproducts_tb");
     _data2DBTable.Add("周期合成产品", "cp_periodicsynthesis_tb");
     if (!File.Exists(_dataBaseXml))
     {
         MessageBox.Show("数据库配置文件不存在,请先配置数据库!");
         return;
     }
     _DBcon      = new ConnectMySqlCloud(_dataBaseXml);
     arg         = DataBaseArg.ParseXml(_dataBaseXml);
     _dataDocDir = arg.OutputDir;
 }
Exemplo n.º 5
0
 private void InitTask()
 {
     CheckFrmMode();
     Load += new EventHandler(frmMod06DataPro_Load);
     lstRegions.SelectedIndexChanged += new EventHandler(lstRegionsSelectedIndexChanged);
     if (File.Exists(_dataBaseXml))
     {
         _dbcon = new ConnectMySqlCloud();
         DataBaseArg arg = DataBaseArg.ParseXml(_dataBaseXml);
         if (_frmMode.ToUpper() == "MOD06" || _frmMode.ToUpper() == "MYD06")
         {
             _outputDir = arg.OutputDir;
         }
         else
         {
             _outputDir = arg.AIRSRootPath;
         }
         txtOutDir.Text     = _outputDir;
         txtHistoryPrj.Text = _outputDir;
     }
     Control.CheckForIllegalCrossThreadCalls = false;//关闭该异常检测的方式来避免异常的出现
     _state = new Action <int, string>(InvokeProgress);
 }
Exemplo n.º 6
0
 public bool ParseArgsXml()
 {
     if (File.Exists(_dataBaseXml))
     {
         DataBaseArg arg      = DataBaseArg.ParseXml(_dataBaseXml);
         string      rootpath = null;
         if (_sensor.ToUpper() == "MODIS")
         {
             rootpath = arg.OutputDir;
         }
         else if (_sensor.ToUpper() == "AIRS")
         {
             rootpath = arg.AIRSRootPath;
         }
         else if (_sensor.ToUpper() == "ISCCP")
         {
             rootpath = arg.ISCCPRootPath;
         }
         else if (_sensor.ToUpper() == "CLOUDSAT")
         {
             rootpath = arg.CloudSATRootPath;
         }
         else
         {
             return(false);
         }
         if (!Directory.Exists(rootpath))
         {
             return(false);
         }
         txtInputDir.Text  = rootpath;
         txtOutputDir.Text = rootpath;
     }
     else
     {
         MessageBox.Show("数据库配置文件不存在!");
     }
     if (File.Exists(_periodPrdsArgsXml))
     {
         _args           = InputArg.ParsePeriodArgsXml(_periodPrdsArgsXml);
         _args.InputDir  = txtInputDir.Text;
         _args.OutputDir = txtOutputDir.Text;
         string temp = "";
         foreach (string type in _args.StatisticsTypes)
         {
             temp += type + ",";
         }
         txtStaticsTypes.Text = temp.Remove(temp.Length - 1);
         temp = "";
         foreach (string type in _args.PeriodTypes)
         {
             temp += type + ",";
         }
         txtPeriodTypes.Text = temp.Remove(temp.Length - 1);
         if (_args.OverWriteHistoryFiles)
         {
             cbxOverlap.Checked = true;
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 7
0
 public bool ParseArgsXml()
 {
     if (File.Exists(_dataBaseXml))
     {
         _dbargs = DataBaseArg.ParseXml(_dataBaseXml);
         string rootpath = null;
         if (_sensor.ToUpper() == "MOD06" || _sensor.ToUpper() == "MYD06")
         {
             rootpath = _dbargs.OutputDir;
         }
         else if (_sensor.ToUpper() == "AIRS")
         {
             rootpath = _dbargs.AIRSRootPath;
         }
         else if (_sensor.ToUpper() == "ISCCP")
         {
             rootpath = _dbargs.ISCCPRootPath;
         }
         else
         {
             return(false);
         }
         if (!Directory.Exists(rootpath))
         {
             throw new ArgumentException("配置文件路径" + rootpath + "未找到,请重试!");
         }
         txtInputDir.Text  = rootpath;
         txtOutputDir.Text = rootpath;
         if (_sensor.ToUpper() == "MOD06")
         {
             radibtnMOD06.Checked = true;
         }
         else if (_sensor.ToUpper() == "AIRS")
         {
             radibtnAIRS.Checked = true;
         }
         else if (_sensor.ToUpper() == "MYD06")
         {
             radibtnMYD06.Checked = true;
         }
     }
     else
     {
         MessageBox.Show("数据库配置文件不存在!");
     }
     if (File.Exists(_periodPrdsArgsXml))
     {
         _args           = InputArg.ParsePeriodArgsXml(_periodPrdsArgsXml);
         _args.InputDir  = txtInputDir.Text;
         _args.OutputDir = txtOutputDir.Text;
         if (_args.StatisticsTypes.Contains("AVG"))
         {
             cbxAVG.Checked = true;
         }
         if (_args.StatisticsTypes.Contains("MIN"))
         {
             cbxMin.Checked = true;
         }
         if (_args.StatisticsTypes.Contains("MAX"))
         {
             cbxMax.Checked = true;
         }
         if (_args.PeriodTypes.Contains("TEN"))
         {
             cbxTen.Checked = true;
         }
         if (_args.PeriodTypes.Contains("MONTH"))
         {
             cbxTen.Checked   = true;
             cbxMonth.Checked = true;
         }
         if (_args.PeriodTypes.Contains("YEAR"))
         {
             cbxTen.Checked   = true;
             cbxMonth.Checked = true;
             cbxYear.Checked  = true;
         }
         if (_args.OverWriteHistoryFiles)
         {
             cbxOverlap.Checked = true;
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }