Exemple #1
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);
     }
 }
Exemple #2
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);
     }
 }