Пример #1
0
        public override void RetrieveRenderKnowledge()
        {
            if (_query.CachedEntities.Count == 0)
            {
                return;
            }
            var lst = new ObservableCollection <IKnowledge>();

            foreach (var cacheObj in _query.CachedEntities)
            {
                var cacheShapeSymbol = cacheObj as ShapeSymbol;
                var cacheGoal        = cacheObj as EqGoal;
                var cacheEq          = cacheObj as Equation;
                if (cacheShapeSymbol != null)
                {
                    starPadSDK.MathExpr.Expr expr = ExprG.Generate(cacheShapeSymbol);
                    var agShape = new AGShapeExpr(expr, cacheShapeSymbol);
                    lst.Add(agShape);
                }
                else if (cacheGoal != null)
                {
                    starPadSDK.MathExpr.Expr expr = ExprG.Generate(cacheGoal);
                    var agGoal = new AGPropertyExpr(expr, cacheGoal);
                    lst.Add(agGoal);
                }
                else if (cacheEq != null)
                {
                    starPadSDK.MathExpr.Expr expr = ExprG.Generate(cacheEq);
                    var agEq = new AGEquationExpr(expr, cacheEq);
                    lst.Add(agEq);
                }
            }
            RenderKnowledge = lst;
        }
Пример #2
0
        private bool EvalExprPatterns(Expr expr, Equation eq, out object output, bool userInput = false)
        {
            object obj = null;

            if (!userInput)
            {
                obj = RelationGraph.AddNode(eq);
            }
            output = new AGEquationExpr(expr, eq);
            return(true);
        }
Пример #3
0
        public override void RetrieveRenderKnowledge()
        {
            if (_equation == null)
            {
                return;
            }
            if (_equation.CachedEntities.Count == 0)
            {
                return;
            }
            var lst = new ObservableCollection <IKnowledge>();

            foreach (var cacheObj in _equation.CachedEntities)
            {
                var cacheShapeSymbol = cacheObj as ShapeSymbol;
                var cacheGoal        = cacheObj as EqGoal;
                var cacheEq          = cacheObj as Equation;
                if (cacheShapeSymbol != null)
                {
                    throw new Exception("TODO");

                    /*                    starPadSDK.MathExpr.Expr expr = ExprG.Generate(cacheShapeSymbol);
                     *                  var agShape = new AGShapeExpr(expr, cacheShapeSymbol);
                     *                  lst.Add(agShape);*/
                }
                else if (cacheGoal != null)
                {
                    throw new Exception("TODO");

                    /*                    starPadSDK.MathExpr.Expr expr = ExprG.Generate(cacheGoal);
                     *                  var agGoal = new AGPropertyExpr(expr, cacheGoal);
                     *                  lst.Add(agGoal);*/
                }
                else if (cacheEq != null)
                {
                    starPadSDK.MathExpr.Expr expr = ExprG.Generate(cacheEq);
                    var agEq = new AGEquationExpr(expr, cacheEq);
                    lst.Add(agEq);
                }
                else
                {
                    var boolValue = cacheObj as bool?;
                    if (boolValue != null)
                    {
                        starPadSDK.MathExpr.Expr expr = ExprG.Generate(boolValue);
                        var agEq = new IKnowledge(expr);
                        lst.Add(agEq);
                    }
                }
            }
            RenderKnowledge = lst;
        }
Пример #4
0
 private bool EvalExprPatterns(Expr expr, Equation eq, out object output, bool userInput = false)
 {
     object obj = null;
     if (!userInput)
     {
         obj = RelationGraph.AddNode(eq);
     }
     output = new AGEquationExpr(expr, eq);
     return true;
 }
Пример #5
0
        public override void RetrieveRenderKnowledge()
        {
            if (_equation == null) return;
            if (_equation.CachedEntities.Count == 0) return;
            var lst = new ObservableCollection<IKnowledge>();

            foreach (var cacheObj in _equation.CachedEntities)
            {
                var cacheShapeSymbol = cacheObj as ShapeSymbol;
                var cacheGoal = cacheObj as EqGoal;
                var cacheEq = cacheObj as Equation;
                if (cacheShapeSymbol != null)
                {
                    throw new Exception("TODO");
                    /*                    starPadSDK.MathExpr.Expr expr = ExprG.Generate(cacheShapeSymbol);
                                        var agShape = new AGShapeExpr(expr, cacheShapeSymbol);
                                        lst.Add(agShape);*/
                }
                else if (cacheGoal != null)
                {
                    throw new Exception("TODO");
                    /*                    starPadSDK.MathExpr.Expr expr = ExprG.Generate(cacheGoal);
                                        var agGoal = new AGPropertyExpr(expr, cacheGoal);
                                        lst.Add(agGoal);*/
                }
                else if (cacheEq != null)
                {
                    starPadSDK.MathExpr.Expr expr = ExprG.Generate(cacheEq);
                    var agEq = new AGEquationExpr(expr, cacheEq);
                    lst.Add(agEq);
                }
                else
                {
                    var boolValue = cacheObj as bool?;
                    if (boolValue != null)
                    {
                        starPadSDK.MathExpr.Expr expr = ExprG.Generate(boolValue);
                        var agEq = new IKnowledge(expr);
                        lst.Add(agEq);
                    }
                }
            }
            RenderKnowledge = lst;
        }