Exemple #1
0
        public override void setUp()
        {
            // TODO Auto-generated method stub
            base.setUp();
            JDFElement.setLongID(false);
            JDFNode     n = new JDFDoc("JDF").getJDFRoot();
            JDFResource r = n.addResource(ElementName.COMPONENT, EnumUsage.Output);

            rl = n.getLink(r, null);
            JDFAttributeMap s1Map = new JDFAttributeMap(EnumPartIDKey.SheetName, "S1");

            rl.setAmount(10, s1Map);
            pa = rl.getAmountPool().getPartAmount(s1Map);
        }
Exemple #2
0
        public virtual void testGetChildElementVector_or()
        {
            JDFDoc          d       = new JDFDoc("AmountPool");
            JDFAmountPool   ap      = (JDFAmountPool)d.getRoot();
            JDFAttributeMap partMap = new JDFAttributeMap("a", "a1");

            partMap.put("b", "b1");
            JDFPartAmount pa1 = ap.appendPartAmount();

            pa1.setAttributes(partMap);
            partMap.put("a", "a2");
            partMap.put("b", "b2");
            JDFPartAmount pa2 = ap.appendPartAmount();

            pa2.setAttributes(partMap);
            VElement v = ap.getChildElementVector(ElementName.PARTAMOUNT, null, partMap, false, 0, false);

            Assert.AreEqual(1, v.Count);
            partMap.put("b", "b1");
            v = ap.getChildElementVector(ElementName.PARTAMOUNT, null, partMap, false, 0, false);
            Assert.AreEqual(2, v.Count);
        }
Exemple #3
0
        public virtual void testPartAmount()
        {
            JDFDoc  d = new JDFDoc(ElementName.JDF);
            JDFNode n = d.getJDFRoot();

            n.setVersion(JDFElement.EnumVersion.Version_1_3);
            n.setType("ConventionalPrinting", true);
            JDFExposedMedia xm  = (JDFExposedMedia)n.addResource(ElementName.EXPOSEDMEDIA, null, EnumUsage.Input, null, null, null, null);
            JDFExposedMedia xm1 = (JDFExposedMedia)xm.addPartition(JDFResource.EnumPartIDKey.SheetName, "Sheet1");

            xm.addPartition(JDFResource.EnumPartIDKey.SheetName, "Sheet2");
            xm1.setAmount(1.0);
            xm.setAmount(2.0);
            JDFAttributeMap map1 = new JDFAttributeMap(JDFResource.EnumPartIDKey.SheetName.getName(), "Sheet1");
            JDFAttributeMap map2 = new JDFAttributeMap(JDFResource.EnumPartIDKey.SheetName.getName(), "Sheet2");

            JDFResourceLink rl = n.getLink(xm, null);
            JDFPartAmount   pa = rl.getCreateAmountPool().getCreatePartAmount(new JDFAttributeMap("SheetName", "Sheet1"));

            pa.setDraftOK(true);
            Assert.IsTrue(pa.getMinStatus() == JDFResource.EnumResStatus.Draft, "draft");
            Assert.IsTrue(!pa.hasAttribute(AttributeName.DRAFTOK), "has no draft");
            Assert.IsTrue(pa.getMinLateStatus() == JDFResource.EnumResStatus.Draft, "late draft");
            pa.removeAttribute(AttributeName.MINSTATUS);
            n.setVersion(JDFElement.EnumVersion.Version_1_2);
            pa.setDraftOK(true);
            Assert.IsTrue(pa.getMinStatus() == JDFResource.EnumResStatus.Draft, "draft");
            Assert.IsTrue(pa.hasAttribute(AttributeName.DRAFTOK), "has draft");
            Assert.IsTrue(!pa.hasAttribute(AttributeName.MINSTATUS), "has no MinStatus");
            Assert.IsTrue(pa.getMinLateStatus() == JDFResource.EnumResStatus.Draft, "late draft");

            rl.setMinAmount(42.0, map1);
            Assert.AreEqual(42.0, rl.getMinAmount(map1), 0.0, "map1min");
            Assert.AreEqual(1.0, rl.getMaxAmount(map1), 0.0, "map1max");
            Assert.AreEqual(2.0, rl.getMinAmount(map2), 0.0, "map2min"); // last default
            Assert.AreEqual(2.0, rl.getMaxAmount(null), 0.0, "map0min"); // last default
            pa.setAmount(55, null);
            Assert.AreEqual(55.0, pa.getAmount(null), 0.0, "pa amount");
        }