Beispiel #1
0
        ///
        ///	 <summary> * append an action to this that references a Test with a term of type term
        ///	 * in the parallel TestPool
        ///	 *  </summary>
        ///	 * <param name="term">
        ///	 *            the type of term in the test </param>
        ///	 * <param name="setTerm">
        ///	 *            the term referenced by PreflightAction@SetRef </param>
        ///	 * <param name="bActionFailsOnTestTrue">
        ///	 *            if true the term is linked directly, if false a the term is
        ///	 *            inverted by enclosing it in a <not> term note that the setTest
        ///	 *            always MUST be true to evaluate.
        ///	 *  </param>
        ///	 * <returns> the newly created action </returns>
        ///
        public virtual JDFAction appendActionSetTest(EnumTerm term, EnumTerm setTerm, bool bActionFailsOnTestTrue)
        {
            JDFAction   action   = appendActionTest(term, bActionFailsOnTestTrue);
            JDFTestPool testPool = (JDFTestPool)getParentNode_KElement().getCreateElement(ElementName.TESTPOOL);
            JDFTest     setTest  = testPool.appendTestTerm(setTerm);

            action.setPreflightActionSetRef(setTest);
            return(action);
        }
Beispiel #2
0
        ///
        ///	 <summary> * append an action to this that references a Test with a term of type term
        ///	 * in the parallel TestPool
        ///	 *  </summary>
        ///	 * <param name="term">
        ///	 *            the type of term in the test </param>
        ///	 * <param name="bActionFailsOnTestTrue">
        ///	 *            if true the term is linked directly, if false a the term is
        ///	 *            inverted by enclosing it in a <not> term </param>
        ///
        public virtual JDFAction appendActionTest(EnumTerm term, bool bActionFailsOnTestTrue)
        {
            JDFAction   action   = appendAction();
            JDFTestPool testPool = (JDFTestPool)getParentNode_KElement().getCreateElement(ElementName.TESTPOOL);
            JDFTest     test     = null;

            if (bActionFailsOnTestTrue)
            {
                test = testPool.appendTestTerm(term);
            }
            else
            {
                test = testPool.appendTest();
                ((JDFnot)test.appendTerm(EnumTerm.not)).appendTerm(term);
            }
            action.setTest(test);
            return(action);
        }
Beispiel #3
0
        ///
        ///	 <summary> * append an action to this that references a Test that defines an exclusion
        ///	 * of two values
        ///	 *  </summary>
        ///	 * <param name="id1">
        ///	 *            the id of the first state or devcap to reference </param>
        ///	 * <param name="id2">
        ///	 *            the id of the 2nd state or devcap to reference
        ///	 *  </param>
        ///	 * <returns> the newly created action </returns>
        ///
        public virtual JDFAction appendExcludeTest(ICapabilityElement t1, ICapabilityElement t2)
        {
            if (t1 == null || t2 == null)
            {
                return(null); // snafu - cant find elements to match
            }
            string id1 = ((JDFElement)t1).appendAnchor(null);
            string id2 = ((JDFElement)t2).appendAnchor(null);

            JDFAction action = appendActionTest(EnumTerm.and, true); // fail if a &&
            // b
            JDFand and = (JDFand)action.getTestTerm();

            JDFEvaluation ev1 = (JDFEvaluation)and.appendTerm(t1.getEvaluationType());

            ev1.setrRef(id1);
            JDFEvaluation ev2 = (JDFEvaluation)and.appendTerm(t2.getEvaluationType());

            ev2.setrRef(id2);

            return(action);
        }