Exemple #1
0
        ///
        ///	 <summary> *  </summary>
        ///
        private void initGBContentCreation()
        {
            theNode.setTypes(new VString(EnumType.LayoutElementProduction.getName(), null));
            JDFRunList      ruli = initDocumentRunList();
            JDFResourceLink rl   = theNode.getLink(ruli, EnumUsage.Input);

            rl.setProcessUsage((EnumProcessUsage)null);
            initLayoutElementProductionParams();
            initConduitRunListOut();
        }
Exemple #2
0
        ///
        ///	 * <param name="icsLevel"> </param>
        ///
        protected internal virtual JDFComponent initOutputComponent()
        {
            if (thePreviousNode != null)
            {
                JDFResource parentOutComp = thePreviousNode.getResource(ElementName.COMPONENT, EnumUsage.Output, 0);
                if (parentOutComp != null)
                {
                    theNode.linkResource(parentOutComp, EnumUsage.Input, null);
                }
            }
            JDFComponent outComp = (JDFComponent)(theParentNode != null ? theParentNode.getResource(ElementName.COMPONENT, EnumUsage.Output, 0) : null);

            if (outComp == null)
            {
                outComp = (JDFComponent)theNode.getCreateResource(ElementName.COMPONENT, EnumUsage.Output, 0);
                outComp.setComponentType(EnumComponentType.FinalProduct, EnumComponentType.Sheet);
                outComp.setProductType("Unknown");
            }
            else
            {
                theNode.linkResource(outComp, EnumUsage.Output, null);
            }

            JDFResourceLink rl = theNode.getLink(outComp, EnumUsage.Output);

            if (vParts != null)
            {
                VJDFAttributeMap reducedMap = getReducedMap(new VString("Side Separation", " "));
                if (reducedMap != null)
                {
                    int size = reducedMap.Count;
                    for (int i = 0; i < size; i++)
                    {
                        JDFAttributeMap part     = reducedMap[i];
                        JDFResource     partComp = outComp.getCreatePartition(part, partIDKeys);
                        partComp.setDescriptiveName("Description for Component part# " + i);
                        JDFAttributeMap newMap = new JDFAttributeMap(part);
                        newMap.put(AttributeName.CONDITION, "Good");
                        rl.setAmount(good, newMap);
                    }
                }
            }
            else
            {
                outComp.setDescriptiveName("MIS-CP output Component");
            }
            // outComp.getCreateLayout();
            JDFMedia inMedia = (JDFMedia)theNode.getResource(ElementName.MEDIA, EnumUsage.Input, 0);

            if (inMedia != null)
            {
                outComp.setDimensions(inMedia.getDimension());
            }
            return(outComp);
        }
Exemple #3
0
        public virtual void testAmountPalletteCompleteManifest()
        {
            JDFElement.setLongID(false);
            JDFDoc  d = new JDFDoc("JDF");
            JDFNode n = d.getJDFRoot();

            n.setType(EnumType.ProcessGroup);
            n.setTypes(new VString("Binding Stacking BoxPacking Palletizing", " "));
            JDFComponent    comp = (JDFComponent)n.addResource(ElementName.COMPONENT, null, EnumUsage.Output, null, null, null, null);
            JDFResourceLink rl   = n.getLink(comp, null);

            rl.setAmount(2, null);
            rl.setDescriptiveName("The link point to 2 pallets with a total comtent of 10000 brochures in 200 boxes");
            JDFComponent compBrochure = (JDFComponent)n.addResource(ElementName.COMPONENT, null, EnumUsage.Input, null, null, null, null);

            compBrochure.setResStatus(EnumResStatus.Available, true);
            compBrochure.setDescriptiveName("The individual Brochures");
            JDFResourceLink rlB = n.getLink(compBrochure, null);

            rlB.setAmount(10000, null);
            rlB.setActualAmount(9700, null);

            for (int i = 0; i < 2; i++)
            {
                // create a pallet partition - may also use the root
                JDFComponent compPallet = (JDFComponent)comp.addPartition(EnumPartIDKey.DeliveryUnit0, "Pallet" + i);
                compPallet.setProductID("Pallet_" + i);

                JDFBundle bundlePallet = compPallet.getCreateBundle();
                int       nBox         = i == 0 ? 100 : 94;
                bundlePallet.setDescriptiveName("Pallet Bundle describing " + nBox + " boxes with " + nBox * 50 + " Brochures Contents total");
                bundlePallet.setTotalAmount(nBox * 50);
                bundlePallet.setBundleType(EnumBundleType.Pallet);

                for (int j = 0; j < nBox; j++)
                {
                    JDFBundleItem biBoxes = bundlePallet.appendBundleItem();
                    JDFComponent  compBox = (JDFComponent)compPallet.addPartition(EnumPartIDKey.DeliveryUnit1, "Box_" + i + "_" + j);
                    compBox.setProductID("Box_" + i + "_" + j);
                    biBoxes.refElement(compBox);
                    biBoxes.setAmount(1);

                    JDFBundle bundleBox = compBox.appendBundle();
                    bundleBox.setDescriptiveName("Bundle describing box #" + j + " with 50 Brochures Contents per box");
                    bundleBox.setTotalAmount(50);
                    bundleBox.setBundleType(EnumBundleType.Box);

                    JDFBundleItem biBrochures = bundleBox.appendBundleItem();
                    biBrochures.refElement(compBrochure);
                    biBrochures.setAmount(50);
                }
            }

            d.write2File(sm_dirTestDataTemp + "MISFinAmountCompleteManifest.jdf", 2, false);
        }
Exemple #4
0
        ///
        ///	 * <param name="icsLevel"> </param>
        ///
        protected internal virtual JDFMedia initPaperMedia()
        {
            JDFResourceLink rlM = null;

            if (thePreviousNode != null)
            {
                JDFMedia media = (JDFMedia)thePreviousNode.getResource(ElementName.MEDIA, EnumUsage.Input, 0);
                if (media != null && !EnumMediaType.Paper.Equals(media.getMediaType()))
                {
                    media = (JDFMedia)thePreviousNode.getResource(ElementName.MEDIA, EnumUsage.Input, 1);
                }
                if (media != null && !EnumMediaType.Paper.Equals(media.getMediaType()))
                {
                    media = null;
                }

                if (media == null)
                {
                    media = getMediaFromNode(thePreviousNode);
                    if (media == null)
                    {
                        VElement v = thePreviousNode.getPredecessors(true, false);
                        if (v != null)
                        {
                            int siz = v.Count;
                            for (int i = 0; i < siz; i++)
                            {
                                media = getMediaFromNode((JDFNode)v[i]);
                                if (media != null)
                                {
                                    break;
                                }
                            }
                        }
                    }
                }
                rlM = theNode.linkResource(media, EnumUsage.Input, null);
            }

            if (rlM == null && theParentNode != null)
            {
                rlM = theNode.linkResource(theParentNode.getResource(ElementName.MEDIA, EnumUsage.Input, 0), EnumUsage.Input, null);
            }

            paperMedia = (JDFMedia)theNode.getCreateResource(ElementName.MEDIA, null, 0);
            paperMedia.setDescriptiveName("the paper to print on");
            paperMedia.setResStatus(EnumResStatus.Unavailable, false);
            paperMedia.setMediaType(EnumMediaType.Paper);
            paperMedia.setDimensionCM(new JDFXYPair(70, 102));
            paperMedia.setWeight(90);
            paperMedia.setThickness(90 / 0.8);
            return(paperMedia);
        }
Exemple #5
0
        public virtual void testAddPhase()
        {
            bool bChanged = sc.setPhase(EnumNodeStatus.InProgress, "i", EnumDeviceStatus.Running, "r");

            Assert.IsTrue(bChanged);
            JDFDoc      docJMF = sc.getDocJMFPhaseTime();
            JDFResponse sig    = (JDFResponse)docJMF.getJMFRoot().getMessageElement(EnumFamily.Response, EnumType.Status, 0);
            JDFJobPhase jp     = sig.getDeviceInfo(0).getJobPhase(0);

            Assert.AreEqual(200, jp.getAmount(), 0);
            sc.addPhase(resID, 0, 100, true);
            sc.setTrackWaste(resID, true);
            JDFResourceLink rlXM = n.getLink(xpMedia, null);

            for (int loop = 1; loop < 4; loop++)
            {
                bChanged = sc.setPhase(EnumNodeStatus.InProgress, "i", EnumDeviceStatus.Running, "r");
                Assert.IsFalse(bChanged);
                docJMF = sc.getDocJMFPhaseTime();
                sig    = (JDFResponse)docJMF.getJMFRoot().getMessageElement(EnumFamily.Response, EnumType.Status, 0);
                jp     = sig.getDeviceInfo(0).getJobPhase(0);
                Assert.AreEqual(200, jp.getAmount(), 0, "multiple setPhase calls do not modify");
                Assert.AreEqual(200, rlXM.getActualAmount(new JDFAttributeMap("Condition", "Good")), 0, "multiple setPhase calls do not modify: " + loop);
                Assert.AreEqual(200.0, jp.getPercentCompleted(), 0, "% " + loop);
                sc.addPhase(resID, 0, 100, true);
                Assert.AreEqual(loop * 100, jp.getWaste(), 0, "" + loop);
                Assert.AreEqual(100 * loop, rlXM.getActualAmount(new JDFAttributeMap("Condition", "Waste")), 0, "multiple setPhase calls do Stack: " + loop);
            }
            sc.setWorkType(EnumWorkType.Alteration);
            bChanged = sc.setPhase(EnumNodeStatus.InProgress, "ii", EnumDeviceStatus.Running, "r");
            Assert.IsTrue(bChanged);
            docJMF = sc.getDocJMFPhaseTime();
            sig    = (JDFResponse)docJMF.getJMFRoot().getMessageElement(EnumFamily.Response, EnumType.Status, 0);
            jp     = sig.getDeviceInfo(0).getJobPhase(0);
            Assert.AreEqual(200, jp.getAmount(), 0);
            Assert.AreEqual(400, jp.getWaste(), 0);
            Assert.IsTrue(jp.hasAttribute(AttributeName.PHASEAMOUNT));
            sig = (JDFResponse)docJMF.getJMFRoot().getMessageElement(EnumFamily.Response, EnumType.Status, 1);
            jp  = sig.getDeviceInfo(0).getJobPhase(0);
            Assert.AreEqual(0.0, jp.getPhaseAmount(), 0.0);
            Assert.AreEqual(EnumWorkType.Alteration, jp.getMISDetails().getWorkType());

            sc.setFirstRefID("dummy");
            sc.addPhase(resID, 0, 100, true);
            sc.setTrackWaste(resID, true);
            sc.setPhase(EnumNodeStatus.InProgress, "i", EnumDeviceStatus.Running, "r");
            docJMF = sc.getDocJMFPhaseTime();
            sig    = (JDFResponse)docJMF.getJMFRoot().getMessageElement(EnumFamily.Response, EnumType.Status, 0);
            jp     = sig.getDeviceInfo(0).getJobPhase(0);
            Assert.IsFalse(jp.hasAttribute(AttributeName.AMOUNT));
            Assert.AreEqual(EnumWorkType.Alteration, jp.getMISDetails().getWorkType());
        }
Exemple #6
0
        ///
        ///	 <summary> * simulate makeReady of this node the internal node will be modified to reflect the makeready all required
        ///	 * resources should be available </summary>
        ///
        public virtual void makeReady()
        {
            if (bExpandGrayBox && EnumType.ProcessGroup.Equals(theNode.getEnumType()) && theNode.hasAttribute(AttributeName.TYPES))
            {
                theExpandedNode = theNode.addCombined(theNode.getTypes());
                VElement resLinks = theNode.getResourceLinks(null);
                if (resLinks != null)
                {
                    int size = resLinks.Count;
                    for (int i = 0; i < size; i++)
                    {
                        ((JDFResourceLink)resLinks[i]).removeAttribute(AttributeName.COMBINEDPROCESSINDEX);
                    }
                }

                initAuditPool(theExpandedNode);
                theExpandedNode.copyElement(theNode.getResourceLinkPool(), null);
            }
            else
            {
                theExpandedNode = theNode;
            }
            VElement nodeLinks = getNodeLinks();

            theStatusCounter.setActiveNode(theExpandedNode, null, nodeLinks);

            VElement vResLinks = theExpandedNode.getResourceLinks(null);

            if (vResLinks != null)
            {
                int siz = vResLinks.Count;
                for (int i = 0; i < siz; i++)
                {
                    JDFResourceLink rl = (JDFResourceLink)vResLinks[i];

                    if (EnumUsage.Input.Equals(rl.getUsage()))
                    {
                        VElement vRes = rl.getTargetVector(-1);
                        for (int j = 0; j < vRes.Count; j++)
                        {
                            VElement leaves = ((JDFResource)vRes[j]).getLeaves(false);
                            for (int k = 0; k < leaves.Count; k++)
                            {
                                JDFResource r = (JDFResource)leaves[k];
                                r.setResStatus(EnumResStatus.Available, true);
                            }
                        }
                    }
                }
            }
        }
            ///
            ///		 * <param name="node"> </param>
            ///		 * <param name="resCmd"> </param>
            ///		 * <returns> the new resource </returns>
            ///
            private JDFResource createNewResource(JDFNode node, JDFResource resCmd)
            {
                JDFResource resTarget = null;
                EnumUsage   u         = enclosingInstance.getUsage();

                if (u != null)
                {
                    resTarget = (JDFResource)node.getCreateResourcePool().copyElement(resCmd, null);
                    JDFResourceLink rl = node.linkResource(resTarget, u, null);
                    rl.copyAttribute(AttributeName.PROCESSUSAGE, enclosingInstance); //JDFResourceCmdParams.this);
                    resTarget = getTargetResource(node);
                }
                return(resTarget);
            }
Exemple #8
0
        public override void setUp()
        {
            base.setUp();
            JDFElement.setLongID(false);
            d = new JDFDoc("JDF");

            n = d.getJDFRoot();
            n.appendXMLComment("Example to illustrate JDF 1.3 Base and MIS compatible amount handling", null);
            n.setType(EnumType.ConventionalPrinting);
            outComp   = (JDFComponent)n.addResource(ElementName.COMPONENT, null, EnumUsage.Output, null, null, null, null);
            inMedia   = (JDFMedia)n.addResource(ElementName.MEDIA, null, EnumUsage.Input, null, null, null, null);
            rlOut     = n.getLink(outComp, null);
            rlMediaIn = n.getLink(inMedia, null);
        }
Exemple #9
0
        ///
        ///	 <summary> * zapp any direct links to colorpool </summary>
        ///
        protected internal override void initColorantControl()
        {
            base.initColorantControl();
            JDFColorPool cp = (JDFColorPool)theNode.getResource(ElementName.COLORPOOL, EnumUsage.Input, 0);

            if (cp != null)
            {
                JDFResourceLink rl = theNode.getLink(cp, EnumUsage.Input);
                if (rl != null)
                {
                    rl.deleteNode();
                }
            }
        }
Exemple #10
0
        ///
        ///	 <summary> *  </summary>
        ///
        private void initStrippingParams()
        {
            JDFStrippingParams sp = (JDFStrippingParams)theNode.getCreateResource(ElementName.STRIPPINGPARAMS, EnumUsage.Input, 0);

            sp.setDescriptiveName("Impositioning for job " + theNode.getJobID(true));
            sp.setWorkStyle(org.cip4.jdflib.auto.JDFAutoStrippingParams.EnumWorkStyle.getEnum(workStyle.getValue()));
            // VJDFAttributeMap reduceMap=
            getReducedMap(new VString("Separation PartVersion", null));
            JDFBinderySignature bs0 = (JDFBinderySignature)theNode.getResource(ElementName.BINDERYSIGNATURE, EnumUsage.Input, 0);
            JDFBinderySignature bs1 = (JDFBinderySignature)theNode.getResource(ElementName.BINDERYSIGNATURE, EnumUsage.Input, 1);

            if (bs1 == null)
            {
                bs1 = bs0;
            }

            if (vParts != null)
            {
                VJDFAttributeMap reducedMap = getReducedMap(new VString("Side Separation PartVersion", " "));
                if (reducedMap != null)
                {
                    int size = reducedMap.Count;
                    for (int i = 0; i < size; i++)
                    {
                        JDFAttributeMap     part   = reducedMap[i];
                        JDFResource         partSP = sp.getCreatePartition(part, partIDKeys);
                        JDFBinderySignature bs     = partSP.getSheetName().ToLower().Contains("cover") ? bs0 : bs1;
                        partSP.refElement(bs);
                        JDFResourceLink rl = theNode.getLink(bs, null);
                        if (rl != null)
                        {
                            rl.deleteNode();
                        }
                    }
                }
            }
            else
            {
                sp.refElement(bs0);
            }

            sp.appendDevice().setDeviceID("Press_ID");
            sp.appendPosition().setRelativeBox(new JDFRectangle(0, 0, 0.5, 1));
            sp.appendPosition().setRelativeBox(new JDFRectangle(0.5, 1, 1, 1));

            sp.appendStripCellParams().setTrimSize(new JDFXYPair(8.5 * 72, 11 * 72));

            sp.refElement(initPaperMedia());
        }
Exemple #11
0
        ///
        ///	 <summary> * apply the parameters in this to all appropriate resources in parentNode or one of parentNode's children
        ///	 *  </summary>
        ///	 * <param name="parentNode"> the node to search in TODO implement resource handling </param>
        ///
        public virtual void applyPipeToNode(JDFNode parentNode)
        {
            if (parentNode == null)
            {
                return;
            }
            VElement vNodes = parentNode.getvJDFNode(null, null, false);

            int size = vNodes.Count;

            for (int i = 0; i < size; i++)
            {
                JDFNode node = (JDFNode)vNodes[i];
                if (!matchesNode(node))
                {
                    continue;
                }
                JDFElement.EnumNodeStatus status = getStatus(); // TODO: set
                // Status
                node.setStatus(status);

                // final boolean isIncremental = (getUpdateMethod () ==
                // EnumUpdateMethod.Incremental);
                double          dAmount = -1.0;
                JDFResourceLink rl      = getResourceLink();

                if (rl != null)
                {
                    JDFResourceLink rlNode = node.getLink(0, rl.Name, new JDFAttributeMap(AttributeName.RREF, rl.getrRef()), null);
                    if (rlNode == null)
                    {
                        throw new JDFException("Applying pipeparams to inconsistent node: missing resourcelink: " + rl.Name);
                    }

                    VJDFAttributeMap vMap = rl.getPartMapVector();
                    if (vMap == null)
                    {
                        vMap = new VJDFAttributeMap();
                        vMap.Add(null);
                    }
                    for (int j = 0; j < vMap.Count; j++)
                    {
                        JDFAttributeMap map = vMap[j];
                        dAmount = rl.getActualAmount(map);
                        rlNode.setActualAmount(dAmount, map);
                    }
                }
            }
        }
Exemple #12
0
        ///
        ///	 * <param name="icsLevel"> </param>
        ///
        protected internal virtual void initPreview()
        {
            JDFResourceLink rlP = null;

            if (theNode.getCombinedProcessIndex(EnumType.InkZoneCalculation, 0) < 0)
            {
                return;
            }
            if (thePreviousNode != null)
            {
                rlP = theNode.linkResource(thePreviousNode.getResource(ElementName.PREVIEW, EnumUsage.Output, 0), EnumUsage.Input, null);
            }
            if (rlP == null && theParentNode != null)
            {
                rlP = theNode.linkResource(theParentNode.getResource(ElementName.PREVIEW, EnumUsage.Input, 0), EnumUsage.Input, null);
            }

            JDFPreview pv = (JDFPreview)theNode.getCreateResource(ElementName.PREVIEW, EnumUsage.Input, 0);

            pv.setResStatus(EnumResStatus.Incomplete, false);
            pv.setPreviewUsage(EnumPreviewUsage.Separation);
            pv.setPartUsage(EnumPartUsage.Explicit);
            pv.setPreviewFileType(bPPF ? EnumPreviewFileType.CIP3Single : EnumPreviewFileType.PNG);

            VJDFAttributeMap reducedMap = bPPF ? getReducedMap(new VString("Side Separation", " ")) : vParts;

            if (reducedMap != null)
            {
                int size = reducedMap.Count;
                for (int i = 0; i < size; i++)
                {
                    JDFAttributeMap part             = new JDFAttributeMap(reducedMap[i]);
                    JDFPreview      previewPartition = (JDFPreview)pv.getCreatePartition(part, partIDKeys);
                    if (bPPF)
                    {
                        preparePreview(previewPartition);
                    }
                    else
                    {
                        for (int j = 0; j < getNCols(); j++)
                        {
                            part.put(EnumPartIDKey.Separation, cols.stringAt(j));
                            JDFPreview sepPreview = (JDFPreview)previewPartition.getCreatePartition(part, partIDKeys);
                            preparePreview(sepPreview);
                        }
                    }
                }
            }
        }
Exemple #13
0
        ///
        ///     <summary> *  </summary>
        ///
        protected internal virtual JDFRunList initDocumentRunList()
        {
            JDFRunList      rl  = (JDFRunList)theNode.getCreateResource(ElementName.RUNLIST, EnumUsage.Input, 0);
            JDFResourceLink rll = theNode.getLink(rl, null);

            if ("Marks".Equals(rll.getProcessUsage()))
            {
                rl  = (JDFRunList)theNode.getCreateResource(ElementName.RUNLIST, EnumUsage.Input, 1);
                rll = theNode.getLink(rl, null);
            }
            rll.setProcessUsage(EnumProcessUsage.Document);
            rl.addPDF(m_pdfFile, 0, -1);
            rl.setNPage(4);
            rl.setDescriptiveName("Description of this RunList");
            return(rl);
        }
Exemple #14
0
        public virtual void testAppendResourceLink()
        {
            JDFDoc          doc = new JDFDoc(ElementName.PIPEPARAMS);
            JDFPipeParams   pp  = (JDFPipeParams)doc.getRoot();
            JDFResourceLink rl  = pp.appendResourceLink("Dummy", true);

            Assert.AreEqual(EnumUsage.Input, rl.getUsage());
            try
            {
                rl = pp.appendResourceLink("Dummy2", true);
                Assert.Fail("max 1 rl");
            }
            catch (Exception)
            {
                // nop
            }
        }
Exemple #15
0
        public virtual void testAmount()
        {
            JDFElement.setLongID(false);
            JDFDoc  d = new JDFDoc("JDF");
            JDFNode n = d.getJDFRoot();

            n.setType(EnumType.ProcessGroup);
            n.setTypes(new VString("Binding Stacking BoxPacking Palletizing", " "));
            JDFComponent    comp = (JDFComponent)n.addResource(ElementName.COMPONENT, null, EnumUsage.Output, null, null, null, null);
            JDFResourceLink rl   = n.getLink(comp, null);

            rl.setAmount(2, null);
            rl.setDescriptiveName("The link point to 2 pallets with a total comtent of 10000 brochures in 200 boxes");

            // create a pallet partition - may also use the root
            JDFComponent compPallet = (JDFComponent)comp.addPartition(EnumPartIDKey.DeliveryUnit0, "Pallet");

            JDFComponent compBox      = (JDFComponent)compPallet.addPartition(EnumPartIDKey.DeliveryUnit1, "Box");
            JDFBundle    bundlePallet = compPallet.appendBundle();

            bundlePallet.setDescriptiveName("Bundle describing 100 boxes with 5000 Brochures Contents total");
            bundlePallet.setTotalAmount(5000);
            bundlePallet.setBundleType(EnumBundleType.Pallet);
            JDFBundleItem biBoxes = bundlePallet.appendBundleItem();

            biBoxes.refElement(compBox);
            biBoxes.setAmount(100);

            JDFComponent compBrochure = (JDFComponent)compBox.addPartition(EnumPartIDKey.DeliveryUnit2, "Brochure");
            JDFBundle    bundleBox    = compBox.appendBundle();

            bundleBox.setDescriptiveName("Bundle describing 1 boxes with 50 Brochures Contents per box");
            bundleBox.setTotalAmount(50);
            bundleBox.setBundleType(EnumBundleType.Box);

            JDFBundleItem biBrochures = bundleBox.appendBundleItem();

            biBrochures.refElement(compBrochure);
            biBrochures.setAmount(50);

            JDFBundle bundleBrochure = compBrochure.appendBundle();

            bundleBrochure.setDescriptiveName("Dummy Bundle to inhibit inheritence of the box Bundle");
            d.write2File(sm_dirTestDataTemp + "MISFinAmount.jdf", 2, false);
        }
Exemple #16
0
        public override void setUp()
        {
            d       = creatXMDoc();
            n       = d.getJDFRoot();
            xpMedia = (JDFExposedMedia)n.getMatchingResource("ExposedMedia", null, null, 0);
            JDFResourceLink rlxp = n.getLink(xpMedia, null);

            rlxp.setAmount(100, null);
            sc       = new StatusCounter(n, null, null);
            deviceID = "Status-counter-TestDevice";
            sc.setDeviceID(deviceID);
            resID = xpMedia.getID();
            sc.setFirstRefID(resID);
            sc.addPhase(resID, 200, 0, true);
            employee = (JDFEmployee) new JDFDoc("Employee").getRoot();
            employee.setPersonalID("P1");
            base.setUp();
        }
Exemple #17
0
        public virtual void testGetLink()
        {
            JDFDoc          doc = new JDFDoc("JDF");
            JDFNode         n   = doc.getJDFRoot();
            JDFResource     r   = n.addResource("www.foo", EnumResourceClass.Parameter, EnumUsage.Input, null, null, "www.www.com", null);
            JDFResourceLink rl  = n.getLink(r, null);
            VElement        vRL = new VElement();

            vRL.Add(rl);

            JDFAuditPool ap = n.getCreateAuditPool();
            JDFPhaseTime pt = ap.addPhaseTime(EnumNodeStatus.InProgress, null, null);

            pt.appendComment().setText("foo");
            pt.setLinks(vRL);
            pt.setStart(new JDFDate());
            Assert.AreEqual(rl.ToString(), pt.getLink(0).ToString());
        }
Exemple #18
0
        public override void setUp()
        {
            base.setUp();
            JDFElement.setLongID(false);
            d = new JDFDoc("JDF");

            n = d.getJDFRoot();
            n.appendXMLComment("Example to illustrate JDF 1.3 Base and MIS compatible amount handling", null);
            n.setType(EnumType.Combined);
            inMedia = (JDFMedia)n.addResource(ElementName.MEDIA, null, EnumUsage.Input, null, null, null, null);
            outXM   = (JDFExposedMedia)n.addResource(ElementName.EXPOSEDMEDIA, EnumUsage.Output);
            outXM.refMedia(inMedia);
            n.addTypes(EnumType.Interpreting);
            n.addTypes(EnumType.Rendering);
            n.addTypes(EnumType.ImageSetting);
            n.setJobID("RIP-job");
            rlXMOut   = n.getLink(outXM, null);
            rlMediaIn = n.getLink(inMedia, null);
            inMedia.setProductID("Media-ProductID");
            inMedia.setMediaType(EnumMediaType.Plate);
            inMedia.setMediaTypeDetails("Aluminum");

            vRL = new VElement();
            vRL.Add(rlMediaIn);
            vRL.Add(rlXMOut);

            JDFExposedMedia xmPart = (JDFExposedMedia)outXM.addPartition(EnumPartIDKey.SignatureName, "Sig1");

            vsSheet = new VString("Cover Sheet1 Sheet2", " ");
            vsCMYK  = new VString("Cyan Magenta Yellow Black Spot1", " ");
            VElement v = xmPart.addPartitions(EnumPartIDKey.SheetName, vsSheet);

            for (int i = 0; i < v.Count; i++)
            {
                JDFResource xmPart2 = (JDFResource)v[i];
                xmPart2.getCreatePartition(EnumPartIDKey.Side, "Front", null).addPartitions(EnumPartIDKey.Separation, vsCMYK);
                // xmPart2.getCreatePartition(EnumPartIDKey.Side,"Back",null).
                // addPartitions(EnumPartIDKey.Separation, vsCMYK);
            }
            statCounter = new StatusCounter(n, null, vRL);
            statCounter.setDeviceID("Rip-DeviceID");
            statCounter.setCopyResInResInfo(rlMediaIn.getrRef(), true);
        }
Exemple #19
0
        /// <summary>
        /// All the setUp calls except for base.setUp.
        /// Use when you want to redo a setup without doign a teardown.
        /// </summary>
        public void reSetUp()
        {
            JDFElement.setLongID(false);
            JDFAudit.setStaticAgentName(null);
            JDFAudit.setStaticAgentVersion(null);
            JDFAudit.setStaticAuthor(null);

            doc = new JDFDoc("JDF");
            n   = doc.getJDFRoot();
            n.setJobID("JobID");
            n.setType(EnumType.Combined);
            n.setTypes(new VString("Interpreting Rendering DigitalPrinting Stitching", " "));
            comp       = (JDFComponent)n.addResource(ElementName.COMPONENT, null, EnumUsage.Output, null, null, null, null);
            rlComp     = n.getLink(comp, null);
            digiParams = (JDFDigitalPrintingParams)n.addResource(ElementName.DIGITALPRINTINGPARAMS, null, EnumUsage.Input, null, null, null, null);
            med        = (JDFMedia)n.appendMatchingResource(ElementName.MEDIA, EnumProcessUsage.AnyInput, null);
            med.setResStatus(EnumResStatus.Available, false);
            rlMedia = n.getLink(med, null);
            ruli    = (JDFRunList)n.appendMatchingResource(ElementName.RUNLIST, EnumProcessUsage.AnyInput, null);
        }
Exemple #20
0
        ///
        ///	 * <param name="good"> </param>
        ///	 * <param name="waste"> </param>
        ///
        protected internal void runSinglePhase(int pgood, int pwaste, bool bOutAvail, bool bFirst)
        {
            VElement vResLinks = theExpandedNode.getResourceLinks(null);

            if (vResLinks != null)
            {
                int siz = vResLinks.Count;
                for (int i = 0; i < siz; i++)
                {
                    int             _good = pgood;
                    JDFResourceLink rl    = (JDFResourceLink)vResLinks[i];
                    // only consume input for first set of runs
                    if (!bFirst && EnumUsage.Input.Equals(rl.getUsage()))
                    {
                        _good = 0;
                    }
                    theStatusCounter.addPhase(rl.getrRef(), _good, pwaste, true);
                }
            }
        }
Exemple #21
0
        public virtual void testGetLink()
        {
            JDFDoc      d = new JDFDoc("JDF");
            JDFNode     n = d.getJDFRoot();
            JDFResource r = n.addResource("Component", null, null, null, null, null, null);

            Assert.IsTrue(r is JDFComponent);
            Assert.IsFalse(n.hasChildElement("ResourceLinkPool", null));
            JDFResourceLinkPool rlp = n.getCreateResourceLinkPool();

            JDFResourceLink rl = rlp.linkResource(r, EnumUsage.Input, EnumProcessUsage.BookBlock);

            Assert.IsNotNull(rl);
            Assert.AreEqual(rlp.getLink(r, null, null), rl);

            JDFResource r2 = n.addResource("foo:bar", EnumResourceClass.Parameter, null, null, null, "www.foo.com", null);

            rl = rlp.linkResource(r2, EnumUsage.Input, null);
            Assert.AreEqual(rlp.getLink(r2, null, null), rl);
        }
Exemple #22
0
        public virtual void testBadResLink()
        {
            JDFDoc  d = new JDFDoc("JDF");
            JDFNode n = d.getJDFRoot();

            n.setType(EnumType.Stitching);
            JDFResource     r  = n.addResource(ElementName.STITCHINGPARAMS, EnumUsage.Input);
            JDFResourceLink rl = n.getLink(r, null);

            Assert.IsTrue(rl.isValid(EnumValidationLevel.Complete));
            Assert.IsTrue(n.isValid(EnumValidationLevel.Incomplete));
            rl.setrRef("badLink");
            Assert.IsFalse(rl.isValid(EnumValidationLevel.Complete));
            Assert.IsFalse(n.isValid(EnumValidationLevel.Complete));
            JDFValidator cj   = new JDFValidator();
            XMLDoc       res  = cj.processSingleDocument(d);
            KElement     root = res.getRoot();
            string       s    = root.ToString();

            Assert.IsTrue(s.IndexOf("Dangling") > 0);
        }
Exemple #23
0
        public virtual void testLayerRunListWithLL()
        {
            JDFElement.setLongID(false);
            setUpDoc();
            setupRunList(0);

            setupLayout(false);

            n.setPartStatus(new JDFAttributeMap(EnumPartIDKey.PartVersion, "De"), EnumNodeStatus.Completed, null);
            JDFResourceLink rl = n.getLink(rlIn, null);

            rl.setPartition(EnumPartIDKey.PartVersion, "De");
            d.write2File(sm_dirTestDataTemp + "LayerListWithLL.jdf", 2, false);
            JDFAttributeMap map = new JDFAttributeMap();

            map.put(EnumPartIDKey.PartVersion, "De");
            map.put(EnumPartIDKey.LayerIDs, "1");
            rl.setPartMap(map);
            rl.setDescriptiveName("Only DE, no bkg partversion is selected");
            d.write2File(sm_dirTestDataTemp + "LayerListWithLL_BKG.jdf", 2, false);
        }
Exemple #24
0
        ///
        ///	 <summary> * initialize deliveryintent and also output component
        ///	 *  </summary>
        ///	 * <param name="amount"> </param>
        ///
        protected internal virtual JDFDeliveryIntent initDeliveryIntent(int amount)
        {
            JDFDeliveryIntent di = (JDFDeliveryIntent)theNode.addResource(ElementName.DELIVERYINTENT, EnumUsage.Input);
            JDFDate           d  = new JDFDate();

            d.addOffset(0, 0, 0, 7);
            di.appendRequired().setPreferred(d);
            if (amount > 0)
            {
                JDFComponent      outComp = (JDFComponent)theNode.getCreateResource(ElementName.COMPONENT, EnumUsage.Output, 0);
                JDFDropItemIntent dit     = di.appendDropIntent().appendDropItemIntent();
                dit.refElement(outComp);
                dit.setAmount(amount);
                JDFResourceLink rl = theNode.getLink(outComp, null);
                rl.setAmount(amount, null);
            }

            di.setResStatus(EnumResStatus.Available, false);
            di.preferredToActual();
            return(di);
        }
Exemple #25
0
        public virtual void testGetResourceLink()
        {
            JDFDoc          doc = new JDFDoc(ElementName.JMF);
            JDFJMF          jmf = doc.getJMFRoot();
            JDFCommand      c   = jmf.appendCommand(EnumType.PipePull);
            JDFPipeParams   pp  = c.appendPipeParams();
            JDFExposedMedia xm  = (JDFExposedMedia)pp.appendResource(ElementName.EXPOSEDMEDIA);

            Assert.AreEqual(EnumResourceClass.Handling, xm.getResourceClass());
            JDFMedia m = (JDFMedia)pp.appendResource(ElementName.MEDIA);

            Assert.AreEqual(EnumResourceClass.Consumable, m.getResourceClass());
            JDFRefElement rm = xm.refElement(m);

            Assert.AreEqual(m, rm.getTarget());
            JDFResourceLink rl = pp.appendResourceLink(ElementName.EXPOSEDMEDIA, true);

            rl.setrRef(xm.getID());
            Assert.AreEqual(xm, rl.getTarget());
            Assert.AreEqual(pp.getResourceLink(), rl);
        }
Exemple #26
0
        ///
        ///	 <summary> * recalculate ncols from parent color intent if it exists </summary>
        ///
        private void initAmountsFromParent()
        {
            if (theParentProduct == null)
            {
                return;
            }
            JDFComponent    c  = (JDFComponent)theParentProduct.getResource(ElementName.COMPONENT, EnumUsage.Output, 0);
            JDFResourceLink cl = theParentProduct.getLink(c, EnumUsage.Output);

            if (cl == null)
            {
                return;
            }
            double amount = cl.getAmount(null);

            if (amount > 0)
            {
                good  = (int)amount;
                waste = (int)(good * 0.1);
            }
        }
Exemple #27
0
        public virtual void testPlannedWaste()
        {
            JDFElement.setLongID(false);
            d = new JDFDoc("JDF");
            n = d.getJDFRoot();
            n.setType(EnumType.ConventionalPrinting);
            outComp = (JDFComponent)n.addResource(ElementName.COMPONENT, null, EnumUsage.Output, null, null, null, null);
            rlOut   = n.getLink(outComp, null);
            JDFAmountPool ap = rlOut.getCreateAmountPool();

            JDFComponent    cover = (JDFComponent)outComp.addPartition(EnumPartIDKey.SheetName, "Cover");
            JDFAttributeMap map   = cover.getPartMap();

            ap.appendXMLComment("Want 10000-10500 good cover sheets and allow for 500 waste cover sheets", null);
            map.put(EnumPartIDKey.Condition, "Good");
            rlOut.setAmount(10000, map);
            rlOut.setMaxAmount(10500, map);
            map.put(EnumPartIDKey.Condition, "Waste");
            rlOut.setMaxAmount(500, map);

            ap.appendXMLComment("Want 20000 good first insert sheets and allow for 200 waste insert sheets", null);
            JDFComponent sheet1 = (JDFComponent)outComp.addPartition(EnumPartIDKey.SheetName, "Sheet1");

            map = sheet1.getPartMap();
            map.put(EnumPartIDKey.Condition, "Good");
            rlOut.setAmount(20000, map);
            map.put(EnumPartIDKey.Condition, "Waste");
            rlOut.setMaxAmount(200, map);

            ap.appendXMLComment("Want 20000 good second insert sheets and allow for 200 waste insert sheets", null);
            JDFComponent sheet2 = (JDFComponent)outComp.addPartition(EnumPartIDKey.SheetName, "Sheet2");

            map = sheet2.getPartMap();
            map.put(EnumPartIDKey.Condition, "Good");
            rlOut.setAmount(20000, map);
            map.put(EnumPartIDKey.Condition, "Waste");
            rlOut.setMaxAmount(100, map);

            d.write2File(sm_dirTestDataTemp + "plannedWaste.jdf", 2, true);
        }
Exemple #28
0
        public virtual void testGetPartAmountNull()
        {
            JDFAttributeMap  map  = new JDFAttributeMap("Separation", "Black");
            VJDFAttributeMap vMap = new VJDFAttributeMap();

            vMap.Add(map);

            JDFResourceLink rl = (JDFResourceLink) new JDFDoc("MediaLink").getRoot();

            ap = rl.appendAmountPool();
            Assert.IsNull(ap.getPartAmount(vMap));
            Assert.IsNull(ap.getPartAmount(map));
            Assert.IsNull(ap.getPartAmount(2));
            Assert.IsNull(ap.getPartAmount(0));

            JDFPartAmount pa = ap.appendPartAmount();

            Assert.IsNull(ap.getPartAmount(vMap));
            Assert.IsNull(ap.getPartAmount(map));
            Assert.IsNull(ap.getPartAmount(2));
            Assert.AreEqual(pa, ap.getPartAmount(0));
        }
Exemple #29
0
        ///
        ///	 <summary> * sets all relevant parameters of <code>this</code> to the values specified in resourceLink or its linked resource
        ///	 * or JDF node
        ///	 *  </summary>
        ///	 * <param name="resourceLink"> the resourceLink to extract the information from </param>
        ///
        public virtual void setLink(JDFResourceLink resourceLink)
        {
            if (resourceLink == null)
            {
                return;
            }
            JDFResource r = resourceLink.getTarget();

            JDFNode parentJDF = resourceLink.getParentJDF();

            setJDF(parentJDF);
            setProcessUsage(resourceLink.getEnumProcessUsage());

            if (r.hasAttribute(AttributeName.PRODUCTID))
            {
                setProductID(r.getProductID());
            }
            setResourceID(r.getID());
            setResourceName(r.LocalName);
            setUsage(resourceLink.getUsage());
            setPartMapVector(resourceLink.getPartMapVector());
        }
Exemple #30
0
        public virtual void testLinkResourcePartition()
        {
            JDFDoc      d = new JDFDoc("JDF");
            JDFNode     n = d.getJDFRoot();
            JDFResource r = n.addResource("Component", null, null, null, null, null, null);

            Assert.IsTrue(r is JDFComponent);
            r = r.addPartition(EnumPartIDKey.SignatureName, "Sig1");
            r.addPartition(EnumPartIDKey.SheetName, "S1");
            Assert.IsFalse(n.hasChildElement("ResourceLinkPool", null));
            JDFResourceLinkPool rlp = n.getCreateResourceLinkPool();

            JDFResourceLink rl = rlp.linkResource(r, EnumUsage.Input, EnumProcessUsage.BookBlock);

            Assert.IsNotNull(rl);
            Assert.AreEqual(EnumProcessUsage.BookBlock, rl.getEnumProcessUsage());
            Assert.AreEqual(EnumUsage.Input, rl.getUsage());
            VJDFAttributeMap v = new VJDFAttributeMap();

            v.Add(new JDFAttributeMap(EnumPartIDKey.SignatureName, "Sig1"));
            Assert.AreEqual(v, rl.getPartMapVector());
        }