Example #1
0
        ///
        ///	 * <param name="amounts"> </param>
        ///	 * <param name="jmfRes"> </param>
        ///
        private void generateResourceSignal(AmountBag[] amounts, JDFJMF jmfRes)
        {
            if (amounts != null)
            {
                VElement vResResourceInfo = getVResLink(amounts, 3);

                JDFSignal           sig = jmfRes.appendSignal(EnumType.Resource);
                JDFResourceQuParams rqp = sig.appendResourceQuParams();
                rqp.setJDF(m_Node);
                rqp.setExact(false);
                bool bAllExact = true;

                for (int i = 0; i < vResResourceInfo.Count; i++)
                {
                    JDFResourceInfo ri     = sig.appendResourceInfo();
                    JDFResourceLink rl     = (JDFResourceLink)vResResourceInfo[i];
                    LinkAmount      la     = getLinkAmount(rl.getrRef());
                    bool            bExact = la.bCopyResInfo;
                    bAllExact = bAllExact && bExact;
                    rqp.setExact(bExact);
                    ri.setLink(rl, rqp);
                }
                rqp.setExact(bAllExact);
            }
        }
Example #2
0
        public virtual void testSetPhaseJMF()
        {
            JDFDoc        docJMF = new JDFDoc("JMF");
            JDFJMF        jmf    = docJMF.getJMFRoot();
            JDFSignal     sig    = jmf.appendSignal(EnumType.Status);
            JDFDeviceInfo di     = sig.appendDeviceInfo();

            di.appendEmployee().setPersonalID("p1");
            JDFJobPhase phase = di.appendJobPhase();

            phase.setPhaseStartTime(new JDFDate());
            phase.setStatus(EnumNodeStatus.Setup);
            phase.setJobID(jdfRoot.getJobID(true));
            phase.setJobPartID(jdfRoot.getJobPartID(true));

            VElement el = myAuditPool.setPhase(jmf);

            Assert.IsNotNull(el);
            Assert.AreEqual(1, myAuditPool.getChildElementVector(ElementName.PHASETIME, null, null, true, 0, true).Count);
            Assert.IsNotNull(((JDFPhaseTime)myAuditPool.getAudit(0, EnumAuditType.PhaseTime, null, null)).getEmployee(0));
            Assert.AreEqual(el, myAuditPool.getChildElementVector(ElementName.PHASETIME, null, null, true, 0, true));

            el = myAuditPool.setPhase(jmf);
            Assert.IsNotNull(el);
            Assert.AreEqual(1, myAuditPool.getChildElementVector(ElementName.PHASETIME, null, null, true, 0, true).Count);
            Assert.AreEqual(el, myAuditPool.getChildElementVector(ElementName.PHASETIME, null, null, true, 0, true));

            phase.setStatus(EnumNodeStatus.Aborted);
            el = myAuditPool.setPhase(jmf);
            Assert.IsNotNull(el);
            Assert.AreEqual(2, myAuditPool.getChildElementVector(ElementName.PHASETIME, null, null, true, 0, true).Count);
            Assert.AreEqual(el[0], myAuditPool.getChildElementVector(ElementName.PHASETIME, null, null, true, 0, true)[1]);
        }
Example #3
0
        public virtual void testAuditsImageSetting()
        {
            for (int i = 0; i < vsSheet.Count; i++)
            {
                string           sheet        = vsSheet.stringAt(i);
                VJDFAttributeMap vmP          = new VJDFAttributeMap();
                JDFAttributeMap  attributeMap = new JDFAttributeMap(EnumPartIDKey.SheetName, sheet);
                attributeMap.put("SignatureName", "Sig1");

                vmP.Add(attributeMap);
                statCounter.setActiveNode(n, vmP, vRL);
                string refXM    = rlXMOut.getrRef();
                string refMedia = rlMediaIn.getrRef();

                statCounter.setTrackWaste(refXM, true);
                statCounter.setTrackWaste(refMedia, false);

                statCounter.setPhase(EnumNodeStatus.Stopped, "PowerOn", EnumDeviceStatus.Stopped, "PowerOn");

                statCounter.setPhase(EnumNodeStatus.InProgress, "Imaging", EnumDeviceStatus.Running, null);
                statCounter.addPhase(refMedia, 5, 0, true);
                statCounter.addPhase(refXM, 5, 0, true);
                statCounter.setPhase(EnumNodeStatus.InProgress, "Imaging", EnumDeviceStatus.Running, null);

                // JDFResourceAudit ra=
                statCounter.setResourceAudit(refMedia, EnumReason.ProcessResult);

                JDFProcessRun pr = statCounter.setProcessResult(EnumNodeStatus.Completed);
                pr.setDescriptiveName("we even have the utterly useless ProcessRun");
            }
            d.write2File(sm_dirTestDataTemp + "ImageSetAmount_.jdf", 2, false);
            JDFDoc d2  = statCounter.getDocJMFResource();
            JDFJMF jmf = d2.getJMFRoot();

            jmf.convertResponses(null);
            JDFSignal       sig = jmf.appendSignal(org.cip4.jdflib.jmf.JDFMessage.EnumType.Notification);
            JDFNotification not = sig.appendNotification();

            not.setXPathAttribute("MileStone/@MileStoneType", "PrepressCompleted");
            not.setXPathAttribute("MileStone/@Amount", "5");
            d2.write2File(sm_dirTestDataTemp + "ImageSetAmount_.jmf", 2, false);
            JDFDoc dStatusJMF = statCounter.getDocJMFPhaseTime();

            jmf = dStatusJMF.getJMFRoot();
            jmf.convertResponses(null);
            dStatusJMF.write2File(sm_dirTestDataTemp + "ImageSetPhaseTime_.jmf", 2, false);
        }
Example #4
0
        public virtual void testModules14()
        {
            VString v = new VString("orig fullList end", null);

            for (int i = 0; i < v.Count; i++)
            {
                reSetUp();
                string       testType = v.stringAt(i);
                JDFAuditPool ap       = n.getCreateAuditPool();
                ap.appendXMLComment("JDF 1.3 incompatible auditing of module phases the REQUIRED time attributes are not set in the ModulePhase elements\n" + "- note that phases may now arbitrarily overlap\n" + "The modulePhase elements now only specify which modules are involved, times are all defined by the phasetime proper", null);
                ap.appendXMLComment("The following phaseTime is executed by one module - the RIP,which executes two process steps (Interpreting and Rendering)", null);
                JDFPhaseTime ptRIP = ap.addPhaseTime(EnumNodeStatus.Setup, null, null);
                JDFDate      date  = new JDFDate();
                ptRIP.setStart(date);

                JDFDoc jmfDoc = new JDFDoc("JMF");
                JDFJMF jmf    = jmfDoc.getJMFRoot();
                jmf.setDescriptiveName("Initial phase when the RIP starts up");
                JDFSignal     signal = jmf.appendSignal(JDFMessage.EnumType.Status);
                JDFDeviceInfo di     = signal.appendDeviceInfo();

                JDFJobPhase jpRIP = di.appendJobPhase();
                di.setDeviceStatus(EnumDeviceStatus.Setup);
                jpRIP.setStartTime(date);
                jpRIP.setStatus(EnumNodeStatus.Setup);
                jpRIP.setJobID(n.getJobID(true));
                jpRIP.setJobPartID(n.getJobPartID(true));

                JDFModuleStatus msRIP = jpRIP.appendModuleStatus();
                msRIP.setCombinedProcessIndex(new JDFIntegerList("0 1"));
                msRIP.setModuleType("Imaging");
                msRIP.setModuleID("ID_Imaging");

                JDFModulePhase mpRIP = ptRIP.appendModulePhase();
                mpRIP.setCombinedProcessIndex(new JDFIntegerList("0 1"));
                mpRIP.setModuleType("Imaging");
                mpRIP.setModuleID("ID_Imaging");

                JDFModuleStatus msPrint = di.appendModuleStatus();
                msPrint.setCombinedProcessIndex(new JDFIntegerList("2"));
                msPrint.setModuleType("Printer");
                msPrint.setModuleID("ID_Printer");

                JDFModuleStatus msStitch = di.appendModuleStatus();
                msStitch.setCombinedProcessIndex(new JDFIntegerList("3"));
                msStitch.setModuleType("Stitcher");
                msStitch.setModuleID("ID_Stitcher");

                jmfDoc.write2File(sm_dirTestDataTemp + "moduleStatus" + testType + "0.jmf", 2, false);
                date.addOffset(0, 5, 0, 0);
                jmf.setTimeStamp(date);

                JDFJobPhase jpPrint = di.appendJobPhase();
                di.setDeviceStatus(EnumDeviceStatus.Running);
                jpPrint.setStatus(EnumNodeStatus.InProgress);
                jpPrint.setStartTime(date);
                jpPrint.setJobID(n.getJobID(true));
                jpPrint.setJobPartID(n.getJobPartID(true));

                msPrint = jpPrint.appendModuleStatus();
                msPrint.setCombinedProcessIndex(new JDFIntegerList("2"));
                msPrint.setModuleType("Printer");
                msPrint.setModuleID("ID_Printer");

                msStitch = jpPrint.appendModuleStatus();
                msStitch.setCombinedProcessIndex(new JDFIntegerList("3"));
                msStitch.setModuleType("Stitcher");
                msStitch.setModuleID("ID_Stitcher");

                di.removeChildren(ElementName.MODULESTATUS, null, null);
                jmf.setDescriptiveName("Phase when the Printer and Finisher start up; RIP is still RIPping");
                jmfDoc.write2File(sm_dirTestDataTemp + "moduleStatus" + testType + "1.jmf", 2, false);

                ap.appendXMLComment("The following phaseTime is executed by two modules - sticher and printer", null);
                JDFPhaseTime   ptPrint = ap.addPhaseTime(EnumNodeStatus.InProgress, null, null);
                JDFModulePhase mpPrint = ptPrint.appendModulePhase();
                mpPrint.setCombinedProcessIndex(new JDFIntegerList("2"));
                mpPrint.setModuleType("Printer");
                mpPrint.setModuleID("ID_Printer");
                ptPrint.setStart(date);

                JDFModulePhase mpStitch = ptPrint.appendModulePhase();
                mpStitch.setCombinedProcessIndex(new JDFIntegerList("3"));
                mpStitch.setModuleType("Stitcher");
                mpStitch.setModuleID("ID_Stitcher");
                date.addOffset(0, 30, 0, 0);
                ptRIP.setEnd(date);

                JDFDeviceInfo di2 = null;
                if (i < 2)
                {
                    JDFSignal signal2 = jmf.appendSignal(JDFMessage.EnumType.Status);
                    di2 = (JDFDeviceInfo)signal2.copyElement(di, null);
                    di2.removeChild(ElementName.JOBPHASE, null, 0);
                    if (i == 1)
                    {
                        JDFModuleStatus directMSRip = (JDFModuleStatus)di2.copyElement(msRIP, null);
                        directMSRip.setDeviceStatus(EnumDeviceStatus.Idle);
                    }
                }
                else
                {
                    jpRIP.setAttribute("EndTime", date.DateTimeISO);
                    jpRIP.setDescriptiveName("Added EndTime to explicitly close phase");
                }
                jmf.setTimeStamp(date);
                jmf.setDescriptiveName("Phase when the RIP has completed, Printer and Finisher are still RIPping");
                jmfDoc.write2File(sm_dirTestDataTemp + "moduleStatus" + testType + "2.jmf", 2, false);

                date.addOffset(0, 70, 0, 0);
                ptPrint.setEnd(date);
                jmf.setTimeStamp(date);

                if (i < 2)
                {
                    signal.deleteNode();
                    signal = jmf.appendSignal(JDFMessage.EnumType.Status);
                    di     = (JDFDeviceInfo)signal.copyElement(di2, null);
                    di.removeChild(ElementName.JOBPHASE, null, 0);
                    di.removeChild(ElementName.MODULESTATUS, null, 0);
                    di.setDeviceStatus(EnumDeviceStatus.Idle);
                    signal.appendXMLComment("Or should the complete list of modules also be specified here?", di);
                }
                else
                {
                    jpRIP.deleteNode();
                    jpPrint.setAttribute("EndTime", date.DateTimeISO);
                    jpPrint.setDescriptiveName("Added EndTime to explicitly close phase");
                }
                jmf.setDescriptiveName("Phase when the Printer and Finisher have completed");
                jmfDoc.write2File(sm_dirTestDataTemp + "moduleStatus" + testType + "3.jmf", 2, false);
                doc.write2File(sm_dirTestDataTemp + "DigiPrintModule.1.4" + testType + ".jdf", 2, false);
            }
        }