Esempio n. 1
0
        // get a design rule value e.g. polygon clearance
        static double GetRuleValue(PCBObject Obj, string kind, string name)
        {
            var P = new Parser();

            foreach (var RuleKind in RuleKindsL)
            {
                if (RuleKind.Kind == kind)
                {
                    foreach (var Rule in RuleKind.Rules)
                    {
                        if (P.Eval(Obj, P.ParseAltiumExpr(Rule.Scope1Expression)) && P.Eval(Obj, P.ParseAltiumExpr(Rule.Scope2Expression)))
                        {
                            return(Rule.Value);
                        }
                    }
                }
            }
            // not found return default value TODO find out what proper default value is
            return(0.1);

            /*
             * foreach (var Rule in RulesL)
             * {
             *  if ((Rule.RuleKind == kind) && (Rule.Name == name))
             *  {
             *      return Rule.Value;
             *  }
             * }
             */
            return(0);
        }
Esempio n. 2
0
 public override bool Eval(PCBObject Obj)
 {
     if (LeftExpression.Eval(Obj) == true)
     {
         return(true);
     }
     return(RightExpression.Eval(Obj));
 }
Esempio n. 3
0
                public override bool Eval(PCBObject Obj)
                {
                    switch (_roleName)
                    {
                    case "All":                return(Obj.All());

                    case "IsArc":              return(Obj.IsArc());

                    case "IsClass":             return(Obj.IsClass());

                    case "IsComponentArc":      return(Obj.IsComponentArc());

                    case "IsComponentFillc":    return(Obj.IsComponentFill());

                    case "IsComponentPad":      return(Obj.IsComponentPad());

                    case "IsComponentTrack":    return(Obj.IsComponentTrack());

                    case "IsConnection":        return(Obj.IsConnection());

                    case "IsCoordinate":        return(Obj.IsCoordinate());

                    case "IsCopperRegion":      return(Obj.IsCopperRegion());

                    case "IsCutoutRegion":      return(Obj.IsCutoutRegion());

                    case "IsDatumDimension":    return(Obj.IsDatumDimension());

                    case "IsDesignator":        return(Obj.IsDesignator());

                    case "IsComment":           return(Obj.IsComment());

                    case "IsFill":              return(Obj.IsFill());

                    case "IsPad":               return(Obj.IsPad());

                    case "IsPoly":              return(Obj.IsPoly());

                    case "IsPolygon":           return(Obj.IsPolygon());

                    case "IsRegion":            return(Obj.IsRegion());

                    case "IsSplitPlane":        return(Obj.IsSplitPlane());

                    case "IsText":              return(Obj.IsText());

                    case "IsTrack":             return(Obj.IsTrack());

                    case "IsVia":               return(Obj.IsVia());

                    case "InComponent":         return(Obj.InComponent(_roleParam));
                    }
                    return(false); // principal.IsInRole(RoleName);
                }
Esempio n. 4
0
        public PCBObject getPCBWithId(int id)
        {
            for (int i = 0; i < PCB.Count(); i++)
            {
                if (PCB[i].id == id)
                {
                    return(PCB[i]);
                }
            }
            PCBObject error = new PCBObject();

            return(error);
        }
Esempio n. 5
0
 public void add(PCBObject x)
 {
     PCB.Add(x);
 }
Esempio n. 6
0
 public bool Eval(PCBObject Obj, Node Expr)
 {
     return(Expr.Eval(Obj));
 }
Esempio n. 7
0
 public override bool Eval(PCBObject Obj)
 {
     return(LeftExpression.EvalExpr(Obj) == RightExpression.EvalExpr(Obj));
 }
Esempio n. 8
0
 public virtual double EvalExpr(PCBObject Obj)
 {
     return(0);
 }
Esempio n. 9
0
 public override double EvalExpr(PCBObject Obj)
 {
     return(0); // LeftExpression.EvalExpr(Obj) != RightExpression.EvalExpr(Obj);
 }
Esempio n. 10
0
 public abstract bool Eval(PCBObject Obj);
Esempio n. 11
0
 public override bool Eval(PCBObject Obj)
 {
     return(!Expression.Eval(Obj));
 }