Example #1
0
 public void Compute(IRasterDataProvider dataProvider, string expression, IRasterBand dstRasterBand, Action <int, string> progressTracker)
 {
     try
     {
         IBandMathExecutor exe = ClassRuntimeGenerator.GenerateBandMathExecutor(GetDataType(dataProvider.DataType), GetDataType(dstRasterBand.DataType));
         exe.Compute(dataProvider, expression, dstRasterBand, progressTracker);
     }
     catch (ArgumentOutOfRangeException)
     {
         throw new ArgumentOutOfRangeException("波段计算公式引用的波段序号超出有效范围!");
     }
 }
Example #2
0
 public void SetExpression(string expression)
 {
     if (string.IsNullOrWhiteSpace(expression))
     {
         return;
     }
     lvBandVars.Tag     = expression;
     txtExpression.Text = expression;
     int[] bandNos;
     ClassRuntimeGenerator.GetOperatorString(expression, out bandNos);
     if (bandNos != null && bandNos.Length > 0)
     {
         foreach (int bNo in bandNos)
         {
             lvBandVars.Items.Add(new BandVarItem("B" + bNo.ToString()));
         }
     }
 }