Esempio n. 1
0
        public virtual void testMIPreComplex()
        {
            for (int i = 0; i < 4; i++)
            {
                for (int ii = 0; ii < 2; ii++)
                {
                    bool bExpand            = ii == 0;
                    ProductGoldenTicket pgt = new ProductGoldenTicket(0, EnumVersion.Version_1_3, 0, 0);
                    pgt.assign(null);
                    pgt.createHDCity();
                    JDFNode node = pgt.getNode();

                    JDFNode            nodePre      = node.addJDFNode(EnumType.ProcessGroup);
                    MISPreGoldenTicket goldenTicket = new MISPreGoldenTicket(1, null, 2, 2, null);
                    goldenTicket.nCols[0]       = goldenTicket.nCols[1] = 4;
                    goldenTicket.workStyle      = EnumWorkStyle.WorkAndTurn;
                    goldenTicket.bExpandGrayBox = bExpand;

                    goldenTicket.setCategory(MISPreGoldenTicket.MISPRE_PREPRESSPREPARATION);
                    goldenTicket.assign(nodePre);
                    pgt.addKid(goldenTicket);

                    MISPreGoldenTicket goldenTicket2 = new MISPreGoldenTicket(goldenTicket, vMap);
                    goldenTicket2.bStripping     = i % 2 == 1;
                    goldenTicket2.bExpandGrayBox = bExpand;

                    JDFNode nodeImp = node.addJDFNode(EnumType.ProcessGroup);
                    goldenTicket2.setCategory(MISPreGoldenTicket.MISPRE_IMPOSITIONPREPARATION);
                    goldenTicket2.assign(nodeImp);
                    pgt.addKid(goldenTicket2);

                    MISPreGoldenTicket goldenTicket3 = new MISPreGoldenTicket(goldenTicket2, null);
                    JDFNode            nodeRIP       = node.addJDFNode(EnumType.ProcessGroup);
                    goldenTicket3.bExpandGrayBox = bExpand;
                    goldenTicket3.setCategory(i < 2 ? MISPreGoldenTicket.MISPRE_IMPOSITIONRIPING : MISPreGoldenTicket.MISPRE_PLATEMAKING);
                    goldenTicket3.assign(nodeRIP);
                    pgt.addKid(goldenTicket3);

                    if (i < 2)
                    {
                        MISPreGoldenTicket goldenTicket4 = new MISPreGoldenTicket(goldenTicket3, null);
                        JDFNode            nodePlateSet  = node.addJDFNode(EnumType.ProcessGroup);
                        goldenTicket4.setCategory(MISPreGoldenTicket.MISPRE_PLATESETTING);
                        goldenTicket4.assign(nodePlateSet);
                        pgt.addKid(goldenTicket4);
                    }

                    BaseGoldenTicketTest.write3GTFiles(this, pgt, "MISPre_ComplexPlate" + (i >= 2 ? "Making" : "Setting") + (goldenTicket2.bStripping ? "Strip" : "") + (bExpand ? "Expand" : ""));
                }
            }
        }
Esempio n. 2
0
        public virtual void testFitsContext()
        {
            JDFDoc  d = new JDFDoc(ElementName.TEST);
            JDFTest t = (JDFTest)d.getRoot();

            t.init();
            t.setContext("//JDF");
            JDFDoc  jdf  = new JDFDoc(ElementName.JDF);
            JDFNode node = jdf.getJDFRoot();

            node.setType(EnumType.ProcessGroup);
            JDFNode     node2 = node.addJDFNode("foobar");
            JDFResource r2    = node.addResource("res", EnumResourceClass.Parameter, EnumUsage.Input, null, null, null, null);

            Assert.IsTrue(t.fitsContext(node));
            Assert.IsTrue(t.fitsContext(node2));
            t.setContext("JDF");
            Assert.IsTrue(t.fitsContext(node));
            Assert.IsTrue(t.fitsContext(node2));
            t.setContext("/JDF");
            Assert.IsTrue(t.fitsContext(node));
            Assert.IsFalse(t.fitsContext(node2));
            t.setContext("res");
            Assert.IsTrue(t.fitsContext(r2));
            t.setContext("/res");
            Assert.IsFalse(t.fitsContext(r2));
        }
Esempio n. 3
0
        public virtual void testMISCPProductGrayBoxBrochure()
        {
            VJDFAttributeMap vMap = new VJDFAttributeMap();

            for (int i = 0; i < 5; i++)
            {
                string          sheetName = i == 0 ? "Cover" : "Body" + i;
                JDFAttributeMap map       = new JDFAttributeMap();
                map.put(EnumPartIDKey.SignatureName, "Sig1");
                map.put(EnumPartIDKey.SheetName, sheetName);
                map.put(EnumPartIDKey.Side, "Front");
                vMap.Add(new JDFAttributeMap(map));
                map.put(EnumPartIDKey.Side, "Back");
                vMap.Add(new JDFAttributeMap(map));
            }

            MISCPGoldenTicket cpGoldenTicket = new MISCPGoldenTicket(1, null, 2, 2, true, vMap);

            cpGoldenTicket.nCols[0]  = cpGoldenTicket.nCols[1] = 6;
            cpGoldenTicket.workStyle = EnumWorkStyle.WorkAndTurn;

            ProductGoldenTicket pgt = new ProductGoldenTicket(0, EnumVersion.Version_1_3, 0, 0);

            pgt.assign(null);
            pgt.createHDCity();
            JDFNode node   = pgt.getNode();
            JDFNode nodeCP = node.addJDFNode(EnumType.ProcessGroup);

            cpGoldenTicket.assign(nodeCP);
            cpGoldenTicket.good  = 1000;
            cpGoldenTicket.waste = 90;

            cpGoldenTicket.partsAtOnce = 2;
            BaseGoldenTicketTest.write3GTFiles(this, cpGoldenTicket, "MISCPS_ProductGrayBox");
        }
Esempio n. 4
0
        public virtual void testMISPreImpositionPreparation()
        {
            for (int i = 0; i < 4; i++)
            {
                MISPreGoldenTicket goldenTicket = new MISPreGoldenTicket(1, null, 2, 2, vMap);
                goldenTicket.bStripping = i % 2 == 1;
                goldenTicket.nCols[0]   = goldenTicket.nCols[1] = 4;
                goldenTicket.workStyle  = EnumWorkStyle.WorkAndTurn;
                goldenTicket.setCategory(MISPreGoldenTicket.MISPRE_IMPOSITIONPREPARATION);

                JDFNode nodePre = null;
                if (i < 2)
                {
                    ProductGoldenTicket pgt = new ProductGoldenTicket(0, EnumVersion.Version_1_3, 0, 0);
                    pgt.assign(null);
                    pgt.createHDCity();
                    JDFNode node = pgt.getNode();
                    nodePre = node.addJDFNode(EnumType.ProcessGroup);
                }
                else
                {
                    // nop
                }

                goldenTicket.assign(nodePre);
                BaseGoldenTicketTest.write3GTFiles(this, goldenTicket, "MISPre_" + (i < 2 ? "GB_" : "") + "ImpositionPreparation" + (goldenTicket.bStripping ? "Strip" : ""));
            }
        }
Esempio n. 5
0
        public virtual void testCopyNodeData()
        {
            JDFDoc  d = new JDFDoc("JDF");
            JDFNode n = d.getJDFRoot();

            n.setType(EnumType.Product);
            JDFNode n1 = n = n.addJDFNode(EnumType.BlockPreparation);

            n1.setAttribute("foo:bar", "fnarf", "www.foobar.com");

            JDFDoc          dA = new JDFDoc("JDF");
            JDFAncestorPool ap = dA.getJDFRoot().appendAncestorPool();

            ap.appendAncestor().setNodeID(n1.getID());
            ap.copyNodeData(n, true, true, false);
            JDFAncestor a0 = ap.getAncestor(0);

            Assert.AreEqual("fnarf", a0.getAttribute("foo:bar"));
            Assert.AreEqual(n1.getID(), a0.getNodeID());
            string    s    = dA.write2String(2);
            JDFParser p    = new JDFParser();
            JDFDoc    test = p.parseString(s);

            Assert.IsNotNull(test);
        }
Esempio n. 6
0
        ///
        ///	 * <param name="theNode"> </param>
        ///	 * <param name="product">
        ///	 * @return </param>
        ///
        protected internal virtual JDFNode addJDFNode(JDFNode node, EnumType t)
        {
            JDFNode newNode = node.addJDFNode(t);

            newNode.setStatus(EnumNodeStatus.Waiting);
            initAuditPool(newNode);
            return(newNode);
        }
Esempio n. 7
0
        public virtual void testInheritedVersionInfo()
        {
            JDFDoc  doc  = new JDFDoc(ElementName.JDF);
            JDFNode node = doc.getJDFRoot();

            node.setVersion(JDFElement.EnumVersion.Version_1_3);
            node.setType(JDFConstants.PROCESSGROUP, true);
            node = node.addJDFNode("Scanning");
            JDFNodeInfo ni = node.appendNodeInfo();

            Assert.IsTrue(ni.hasAttribute(AttributeName.CLASS));
            Assert.AreEqual(EnumVersion.Version_1_3, ni.getVersion(true));
        }
Esempio n. 8
0
        public virtual void testDefaultVersion()
        {
            JDFDoc  doc = new JDFDoc("JDF");
            JDFNode n   = doc.getJDFRoot();

            Assert.AreEqual(n.getVersion(true), EnumVersion.Version_1_3);
            JDFElement.setDefaultJDFVersion(EnumVersion.Version_1_2);
            n.setType("ProcessGroup", true);
            n = n.addJDFNode("Combined");
            Assert.AreEqual(EnumVersion.Version_1_3, n.getVersion(true));

            doc = new JDFDoc("JDF");
            n   = doc.getJDFRoot();
            Assert.AreEqual(EnumVersion.Version_1_2, n.getVersion(true));
            n.setType("ProcessGroup", true);
            n = n.addJDFNode("Combined");
            Assert.AreEqual(EnumVersion.Version_1_2, n.getVersion(true));

            doc = new JDFDoc("JMF");
            JDFJMF jmf = doc.getJMFRoot();

            Assert.AreEqual(EnumVersion.Version_1_2, jmf.getVersion(true));
        }
Esempio n. 9
0
        public virtual void testGetLinkRoot()
        {
            JDFDoc  d = new JDFDoc(ElementName.JDF);
            JDFNode n = d.getJDFRoot();

            n.setType("ProcessGroup", true);
            JDFNode         n2     = n.addJDFNode("ConventionalPrinting");
            JDFCustomerInfo ci     = (JDFCustomerInfo)n.addResource(ElementName.CUSTOMERINFO, null, EnumUsage.Input, null, null, null, null);
            JDFResourceLink ciLink = n.getLink(ci, null);

            Assert.IsTrue(ci == ciLink.getLinkRoot(), "getLinkRoot in same node");
            Assert.IsTrue(ci == ciLink.getTarget(), "getLinkTarget in same node");
            Assert.IsTrue(ci == ciLink.getTarget(), "getTarget in same node");

            JDFResourceLink ciLink2 = n2.linkResource(ci, EnumUsage.Input, null);

            Assert.IsTrue(ci == ciLink2.getLinkRoot(), "getLinkRoot in child node");
            Assert.IsTrue(ci == ciLink2.getTarget(), "getLinkTarget in child node");
            Assert.IsTrue(ci == ciLink2.getTarget(), "getTarget in child node");

            JDFNodeInfo     ni     = (JDFNodeInfo)n2.addResource(ElementName.NODEINFO, null, null, null, null, null, null);
            JDFResourceLink niLink = n2.linkResource(ni, EnumUsage.Input, null);

            Assert.IsTrue(ni == niLink.getLinkRoot(), "getLinkRoot both in child node");
            Assert.IsTrue(ni == niLink.getTarget(), "getLinkTarget both in child node");
            Assert.IsTrue(ni == niLink.getTarget(), "getTarget both in child node");

            JDFResourceLink niLink2 = (JDFResourceLink)n.getCreateResourceLinkPool().appendElement("NodeInfoLink", null);

            niLink2.setrRef(ni.getID());
            Assert.IsTrue(niLink2.getLinkRoot() == null, "getLinkRoot illegal in child node");
            Assert.IsTrue(niLink2.getTarget() == null, "getLinkTarget illegal in child node");
            Assert.IsTrue(niLink2.getTarget() == null, "getTarget illegal in child node");

            JDFDoc              d22 = new JDFDoc(ElementName.JDF);
            JDFNode             n22 = d22.getJDFRoot();
            JDFResourceLinkPool rlp = n22.getCreateResourceLinkPool();
            bool bCaught            = false;

            try
            {
                rlp.linkResource(ni, EnumUsage.Input, null);
            }
            catch (JDFException)
            {
                bCaught = true;
            }
            Assert.IsTrue(bCaught, "Resource from other document not linked");
            Assert.IsNull(rlp.getElement("NodeInfoLink"), "NI not linked");
        }
Esempio n. 10
0
        public virtual void testGetParentJDFNode()
        {
            JDFDoc  d = new JDFDoc("JDF");
            JDFNode n = d.getJDFRoot();

            n.setType("ProcessGroup", true);
            JDFNode n2 = n.addJDFNode("Scanning");

            Assert.AreEqual(n, n2.getParentJDF(), "n2.parent n");
            Assert.IsNull(n.getParentJDF(), "n parent");
            JDFAuditPool ap = n.getCreateAuditPool();

            Assert.AreEqual(n, ap.getParentJDF(), "ap.parent n");
            ap = n2.getCreateAuditPool();
            Assert.AreEqual(n2, ap.getParentJDF(), "ap.parent n2");
            Assert.AreEqual(n2, ap.addCreated("me", n2).getParentJDF(), "a.parent n2");
        }
Esempio n. 11
0
        public virtual void testValidPosition()
        {
            JDFDoc  d = new JDFDoc(ElementName.JDF);
            JDFNode n = d.getJDFRoot();

            n.setType(EnumType.ProcessGroup);
            JDFResource     rBar = n.addResource("Bar", EnumResourceClass.Parameter, EnumUsage.Input, null, null, null, null);
            JDFResourceLink rl   = n.getLink(rBar, null);

            Assert.IsNotNull(rl);
            Assert.IsTrue((rl.isValid(null)));
            JDFNode n2 = n.addJDFNode("Whatever");

            n2.moveElement(n.getResourcePool(), null);
            Assert.IsFalse((rl.isValid(null)));
            Assert.IsFalse((rl.validResourcePosition()));
        }
Esempio n. 12
0
        public virtual void testMISPreContentCreation()
        {
            MISPreGoldenTicket goldenTicket = new MISPreGoldenTicket(1, null, 2, 2, vMap);

            goldenTicket.nCols[0]  = goldenTicket.nCols[1] = 4;
            goldenTicket.workStyle = EnumWorkStyle.WorkAndTurn;
            goldenTicket.setCategory(MISPreGoldenTicket.MISPRE_CONTENTCREATION);

            ProductGoldenTicket pgt = new ProductGoldenTicket(0, EnumVersion.Version_1_3, 0, 0);

            pgt.assign(null);
            pgt.createHDCity();
            JDFNode node    = pgt.getNode();
            JDFNode nodePre = node.addJDFNode(EnumType.ProcessGroup);

            goldenTicket.assign(nodePre);
            BaseGoldenTicketTest.write3GTFiles(this, goldenTicket, "MISPre_ContentCreation");
        }
Esempio n. 13
0
        public virtual void testGetMatchingDeviceCapVector()
        {
            JDFDoc  d = new JDFDoc("JDF");
            JDFNode n = d.getJDFRoot();

            n.setType("bar", false);
            Assert.IsNull(device.getMatchingDeviceCapVector(n, true));
            Assert.IsNull(device.getMatchingDeviceCapVector(n, false));
            n.setType("fnarf", false);
            Assert.AreEqual(2, device.getMatchingDeviceCapVector(n, true).Count);
            Assert.AreEqual(2, device.getMatchingDeviceCapVector(n, false).Count);
            n.setType("ProcessGroup", true);
            JDFNode n2 = n.addJDFNode("fnarf");

            Assert.AreEqual(1, device.getMatchingDeviceCapVector(n, true).Count);
            Assert.AreEqual(devicecapProduct, device.getMatchingDeviceCapVector(n, false)[0]);
            Assert.AreEqual(2, device.getMatchingDeviceCapVector(n2, false).Count);
        }
Esempio n. 14
0
        public virtual void testMatchesType()
        {
            JDFDoc  d = new JDFDoc("JDF");
            JDFNode n = d.getJDFRoot();

            n.setType("bar", false);
            Assert.IsFalse(devicecap.matchesType(n, true));
            Assert.IsFalse(devicecap.matchesType(n, false));
            Assert.IsFalse(device.matchesType(n, true));
            Assert.IsFalse(device.matchesType(n, false));

            n.setType("fnarf", false);
            Assert.IsTrue(devicecap.matchesType(n, true));
            Assert.IsTrue(devicecap.matchesType(n, false));
            Assert.IsTrue(device.matchesType(n, true));
            Assert.IsTrue(device.matchesType(n, false));

            n.setType("blub", false);
            Assert.IsTrue(devicecap.matchesType(n, true));
            Assert.IsTrue(devicecap.matchesType(n, false));
            Assert.IsTrue(device.matchesType(n, true));
            Assert.IsTrue(device.matchesType(n, false));

            n.setType("Combined", false);
            n.setTypes(new VString("blub fnarf", " "));
            Assert.IsFalse(devicecap.matchesType(n, true));
            Assert.IsFalse(devicecap.matchesType(n, false));
            Assert.IsTrue(devicecapProduct.matchesType(n, true));
            Assert.IsTrue(devicecapProduct.matchesType(n, false));
            Assert.IsTrue(device.matchesType(n, false));

            devicecap.setCombinedMethod(EnumCombinedMethod.ProcessGroup);
            n.setType("ProcessGroup", true);
            JDFNode n2 = n.addJDFNode("fnarf");

            Assert.IsFalse(devicecap.matchesType(n, true));
            Assert.IsTrue(devicecap.matchesType(n, false));
            Assert.IsTrue(device.matchesType(n, true));
            Assert.IsTrue(device.matchesType(n, false));
            Assert.IsFalse(devicecap.matchesType(n2, true), "method pg for local individual process");
            Assert.IsFalse(devicecap.matchesType(n2, false));
            Assert.IsTrue(devicecapProduct.matchesType(n2, false));
            Assert.IsTrue(device.matchesType(n2, false));
        }
Esempio n. 15
0
        public virtual void testGetMatchingTypeNodeVector()
        {
            JDFDoc  d = new JDFDoc("JDF");
            JDFNode n = d.getJDFRoot();

            n.setType("bar", false);
            Assert.IsNull(devicecap.getMatchingTypeNodeVector(n));

            n.setType("fnarf", false);
            Assert.IsTrue(devicecap.getMatchingTypeNodeVector(n).Contains(n));

            devicecap.setCombinedMethod(EnumCombinedMethod.ProcessGroup);
            n.setType("ProcessGroup", true);
            JDFNode n2 = n.addJDFNode("fnarf");

            Assert.IsFalse(devicecap.getMatchingTypeNodeVector(n).Contains(n), "Only the actually matching nodes are returned, not their ancestors");
            Assert.IsTrue(devicecap.getMatchingTypeNodeVector(n).Contains(n2));
            Assert.IsNull(devicecap.getMatchingTypeNodeVector(n2), "want pg but have local node");
        }