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]); }
public virtual void testPerfectingJMF() { JDFElement.setLongID(false); JDFJMF jmfStatus = JDFJMF.createJMF(EnumFamily.Signal, EnumType.Status); jmfStatus.setSenderID("thePress"); JDFSignal sig = jmfStatus.getSignal(0); JDFDeviceInfo di = sig.appendDeviceInfo(); di.setDeviceStatus(EnumDeviceStatus.Running); JDFJobPhase jp = di.appendJobPhase(); jp.setJobID("jobID"); jp.setJobPartID("jobPartID"); jp.setStatus(EnumNodeStatus.InProgress); JDFModuleStatus ms = jp.appendModuleStatus(); ms.setModuleID("ID_Perfecting_1"); ms.setModuleType("PerfectingModule"); ms.setDeviceStatus(EnumDeviceStatus.Idle); ms = jp.appendModuleStatus(); ms.setModuleType("PrintModule"); ms.setDeviceStatus(EnumDeviceStatus.Running); ms.setModuleIndex(new JDFIntegerRangeList("0 1 3 4")); ms = jp.appendModuleStatus(); ms.setModuleType("PrintModule"); ms.setDeviceStatus(EnumDeviceStatus.Idle); ms.setModuleIndex(new JDFIntegerRangeList("2")); jmfStatus.getOwnerDocument_JDFElement().write2File(sm_dirTestDataTemp + "StatusPerfecting.jmf", 2, false); Assert.IsTrue(jmfStatus.isValid(EnumValidationLevel.Complete), "known defect - wait for autoclass fix"); }
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); } }