コード例 #1
0
ファイル: VariableMeasure.cs プロジェクト: Erroman/universal
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="symbol">Symbol of variable</param>
        /// <param name="measure">Measure</param>
        /// <param name="detector">Detector of variables</param>
        internal VariableMeasurement(string symbol, IMeasurement measure, IVariableDetector detector)
        {
            this.symbol      = symbol;
            this.measurement = measure;
            this.detector    = detector;
            object par = measure.Type;

            if (par is IOneVariableFunction)
            {
                func = par as IOneVariableFunction;
                operationDetector = new OneVariableFunctionDetector(detector);
                funcwrapper       = new OneVariableFunctionDetector(func);
            }
            else if (par is Table2D)
            {
                table2D = par as Table2D;
            }
            else if (par is Table3D)
            {
                table3D = par as Table3D;
            }

            /*!!!   else if (par is FuncReturn)
             * {
             *     funcReturn = par as FuncReturn;
             *     //operationDetector = new FormulaEditor.Func.FuncDetector(detector,  )
             * }*/
            else
            {
                acceptor = this;
            }
            tree = new ObjectFormulaTree(this, new List <ObjectFormulaTree>());
        }
コード例 #2
0
ファイル: VariableMeasure.cs プロジェクト: Erroman/universal
 IObjectOperation IOperationAcceptor.Accept(object type)
 {
     /**!!!!        if (funcReturn != null)
      *      {
      *          IOperationDetector d = new FormulaEditor.Func.FuncDetector(funcReturn, measurement.Parameter());
      *      }
      */
     if (func != null)
     {
         func        = measurement.Parameter() as IOneVariableFunction;
         funcwrapper = new OneVariableFunctionDetector(func);
         return(OneVariableFunctionDetector.Accept(funcwrapper, type));
     }
     if (table2D != null)
     {
         return(table2D);
     }
     if (table3D != null)
     {
         return(table3D);
     }
     return(this);
 }