Пример #1
0
        public virtual void testApplyResourceCmdNodeInfo()
        {
            JDFDoc doc = new JDFDoc(ElementName.JMF);
            JDFJMF jmf = doc.getJMFRoot();

            JDFCommand c = jmf.appendCommand();

            jmf.setSenderID("DeviceSenderID");

            c.setType(EnumType.Resource);
            JDFResourceCmdParams rqp = c.appendResourceCmdParams();

            rqp.setJobID("JobID");
            rqp.setJobPartID("JobPartID");
            rqp.setResourceName(ElementName.NODEINFO);
            rqp.setUsage(EnumUsage.Input);
            JDFNodeInfo niRQP = (JDFNodeInfo)rqp.appendElement(ElementName.NODEINFO);

            JDFAttributeMap sheetMap = new JDFAttributeMap("SheetName", "S1");

            rqp.setPartMap(sheetMap);
            JDFNodeInfo niRQPS1 = (JDFNodeInfo)niRQP.getCreatePartition(sheetMap, null);

            niRQPS1.setNodeStatus(EnumNodeStatus.Aborted);
            JDFDoc  docJDF = new JDFDoc(ElementName.JDF);
            JDFNode jdf    = docJDF.getJDFRoot();

            jdf.setType(org.cip4.jdflib.node.JDFNode.EnumType.ConventionalPrinting);
            jdf.setStatus(EnumNodeStatus.Waiting);
            jdf.setJobID("JobID");
            jdf.setJobPartID("JobPartID");

            Assert.AreEqual(EnumNodeStatus.Waiting, jdf.getPartStatus(null));
            Assert.AreEqual(EnumNodeStatus.Waiting, jdf.getStatus());
            rqp.applyResourceCommand(jdf);
            Assert.AreEqual(EnumNodeStatus.Part, jdf.getStatus());
            Assert.AreEqual(EnumNodeStatus.Waiting, jdf.getNodeInfo().getNodeStatus());
            Assert.AreEqual(EnumNodeStatus.Aborted, jdf.getPartStatus(sheetMap));

            sheetMap = new JDFAttributeMap("SheetName", "S2");
            rqp.setPartMap(sheetMap);
            niRQPS1.setAttributes(sheetMap);
            niRQPS1.setNodeStatus(EnumNodeStatus.Completed);

            rqp.applyResourceCommand(jdf);
            Assert.AreEqual(EnumNodeStatus.Part, jdf.getStatus());
            Assert.AreEqual(EnumNodeStatus.Waiting, jdf.getNodeInfo().getNodeStatus());
            Assert.AreEqual(EnumNodeStatus.Completed, jdf.getPartStatus(sheetMap));
        }
Пример #2
0
        ///
        ///	 <summary> * schedule this node the nodeinfo will be modified </summary>
        ///
        public virtual void schedule(VJDFAttributeMap nodesToCombine, int starthours, int durationhours)
        {
            VJDFAttributeMap nodesToCombineLocal = nodesToCombine;

            theNode.setPartStatus(nodesToCombineLocal, EnumNodeStatus.Waiting, null);
            JDFNodeInfo ni = theNode.getNodeInfo();

            if (nodesToCombineLocal == null)
            {
                nodesToCombineLocal = new VJDFAttributeMap();
                nodesToCombineLocal.Add(null);
            }
            for (int i = 0; i < nodesToCombineLocal.Count; i++)
            {
                JDFNodeInfo nip = (JDFNodeInfo)ni.getCreatePartition(nodesToCombineLocal[i], null);
                JDFDate     d   = new JDFDate();
                d.addOffset(0, 0, starthours, 0);
                nip.setStart(d);
                d.addOffset(0, 0, durationhours, 0);
                nip.setEnd(d);
            }
        }
Пример #3
0
        ///
        ///	 * <param name="icsLevel">
        ///	 * @return </param>
        ///
        protected internal override JDFNodeInfo initNodeInfo()
        {
            JDFNodeInfo ni = base.initNodeInfo();

            if (vParts != null)
            {
                VJDFAttributeMap reducedMap = new VJDFAttributeMap(vParts);
                VString          reduceKeys = new VString(partIDKeys);
                // simplex and perfecting are one run only
                if (EnumWorkStyle.Simplex.Equals(workStyle) || EnumWorkStyle.Perfecting.Equals(workStyle))
                {
                    reduceKeys.Remove(AttributeName.SIDE);
                }
                reducedMap.reduceMap(reduceKeys.getSet());
                theNode.setPartStatus(reducedMap, EnumNodeStatus.Waiting, null);
                for (int i = 0; i < reducedMap.Count; i++)
                {
                    JDFAttributeMap part   = reducedMap[i];
                    JDFNodeInfo     niPart = (JDFNodeInfo)ni.getCreatePartition(part, partIDKeys);
                    niPart.setDescriptiveName("Printing for" + part.ToString());
                }
            }
            return(ni);
        }
Пример #4
0
        protected internal static JDFDoc creatXMDoc()
        {
            JDFElement.setDefaultJDFVersion(EnumVersion.Version_1_3);
            JDFDoc  doc = new JDFDoc("JDF");
            JDFNode n   = doc.getJDFRoot();

            n.setJobPartID("P1");
            n.setJobID("J1");
            n.setType("ConventionalPrinting", true);
            n.appendElement("NS:Foobar", "www.foobar.com");

            n.appendMatchingResource("Layout", JDFNode.EnumProcessUsage.AnyInput, null);
            JDFComponent    comp = (JDFComponent)n.appendMatchingResource("Component", JDFNode.EnumProcessUsage.AnyOutput, null);
            JDFExposedMedia xm   = (JDFExposedMedia)n.appendMatchingResource("ExposedMedia", JDFNode.EnumProcessUsage.Plate, null);
            JDFNodeInfo     ni   = n.appendNodeInfo();
            JDFMedia        m    = xm.appendMedia();

            m.appendElement("NS:FoobarMedia", "www.foobar.com");

            Assert.AreEqual(EnumResourceClass.Consumable, m.getResourceClass(), "m Class");

            VString vs = new VString();

            vs.Add("SignatureName");
            vs.Add("SheetName");
            vs.Add("Side");

            JDFAttributeMap mPart1 = new JDFAttributeMap("SignatureName", "Sig1");

            mPart1.put("SheetName", "S1");
            mPart1.put("Side", "Front");
            xm.getCreatePartition(mPart1, vs);
            ni.getCreatePartition(mPart1, vs);
            comp.getCreatePartition(mPart1, vs);

            mPart1.put("Side", "Back");
            xm.getCreatePartition(mPart1, vs);
            ni.getCreatePartition(mPart1, vs);
            comp.getCreatePartition(mPart1, vs);

            mPart1.put("SheetName", "S2");
            mPart1.put("Side", "Front");
            xm.getCreatePartition(mPart1, vs);
            ni.getCreatePartition(mPart1, vs);
            comp.getCreatePartition(mPart1, vs);

            mPart1.put("Side", "Back");
            xm.getCreatePartition(mPart1, vs);
            ni.getCreatePartition(mPart1, vs);
            comp.getCreatePartition(mPart1, vs);

            mPart1.put("SignatureName", "Sig2");
            mPart1.put("SheetName", "S1");
            mPart1.put("Side", "Front");
            xm.getCreatePartition(mPart1, vs);
            ni.getCreatePartition(mPart1, vs);
            comp.getCreatePartition(mPart1, vs);
            comp.appendElement("foo:bar", "www.foobar.com");

            mPart1.put("Side", "Back");
            xm.getCreatePartition(mPart1, vs);
            ni.getCreatePartition(mPart1, vs);
            comp.getCreatePartition(mPart1, vs);

            mPart1.put("SheetName", "S2");
            mPart1.put("Side", "Front");
            xm.getCreatePartition(mPart1, vs);
            ni.getCreatePartition(mPart1, vs);
            comp.getCreatePartition(mPart1, vs);

            mPart1.put("Side", "Back");
            xm.getCreatePartition(mPart1, vs);
            ni.getCreatePartition(mPart1, vs);
            comp.getCreatePartition(mPart1, vs);
            return(doc);
        }