Example #1
0
        ///
        ///	 <summary> * Create or modify a PhaseTime Audit and fill it If the phase is identical to the prior phase that has been set,
        ///	 * the existing PhaseTime is modified otherwise an existing phaseTime is closed and a new phaseTime is appended
        ///	 * Phasetime elements with different Parts are treated independently
        ///	 *  </summary>
        ///	 * <param name="status"> the node status at this time </param>
        ///	 * <param name="statusDetails"> details of this status </param>
        ///	 * <param name="vmParts"> defines a vector of map of parts for which the PhaseTime is valid </param>
        ///	 * <param name="employees"> Vector of employees that are currently registered for this job </param>
        ///	 * <returns> JDFPhaseTime the newly created PhaseTime audit
        ///	 *
        ///	 *         default: SetPhase(status, null,null,null) </returns>
        ///
        public virtual JDFPhaseTime setPhase(EnumNodeStatus status, string statusDetails, VJDFAttributeMap vmParts, VElement employees)
        {
            string statusDetailsLocal = statusDetails;

            JDFPhaseTime pt = getLastPhase(vmParts, null);

            statusDetailsLocal = StringUtil.getNonEmpty(statusDetailsLocal);
            bool     bChanged    = false;
            VElement ptEmployees = pt == null ? new VElement() : pt.getChildElementVector(ElementName.EMPLOYEE, null);

            if (pt == null)
            {
                bChanged = true;
            }
            else if (!ContainerUtil.Equals(pt.getStatus(), status) || !ContainerUtil.Equals(statusDetailsLocal, pt.getAttribute(AttributeName.STATUSDETAILS, null, null)) || !ptEmployees.isEqual(employees))
            {
                pt.setEnd(new JDFDate());
                bChanged = true;
            }
            if (bChanged)
            {
                pt = addPhaseTime(status, null, vmParts);
                pt.setStatusDetails(statusDetailsLocal);
                pt.copyElements(employees, null);
            }
            return(pt);
        }
Example #2
0
        private void iterateLast()
        {
            iterateRead(4);
            JDFPhaseTime pt = iterNode.getAuditPool().setPhase(EnumNodeStatus.InProgress, "Final Iteration Ongoing - final output", null, null);

            pt.setStart(new JDFDate(JDFDate.ToMillisecs(DateTime.Now) + 4000000));
            pt.setEnd(new JDFDate(JDFDate.ToMillisecs(DateTime.Now) + 4100000));
            pt.appendEmployee().setPersonalID("Employee 1");
            pt.appendDevice().setDeviceID("Device 1");
            iterNode.setStatus(EnumNodeStatus.Completed);
            iterDoc.write2File(getIteration(5), 2, false);
        }
Example #3
0
        private void iterateSecond()
        {
            iterateRead(1);
            JDFPhaseTime pt = iterNode.getAuditPool().setPhase(EnumNodeStatus.InProgress, "First Approval Ongoing", null, null);

            pt.setStart(new JDFDate(JDFDate.ToMillisecs(DateTime.Now) + 1000000));
            pt.setEnd(new JDFDate(JDFDate.ToMillisecs(DateTime.Now) + 1100000));
            pt.appendEmployee().setPersonalID("Employee 2");
            pt.appendDevice().setDeviceID("Approval Device 1");
            iterRuli.setResStatus(EnumResStatus.Rejected, false);
            iterNode.setStatus(EnumNodeStatus.Suspended);
            iterNode.setAttribute("StatusDetails", ITERATION_PAUSED);
            iterDoc.write2File(getIteration(2), 2, false);
        }
Example #4
0
        private void iterateForth()
        {
            iterateRead(3);
            JDFPhaseTime pt = iterNode.getAuditPool().setPhase(EnumNodeStatus.InProgress, "Second Approval Ongoing", null, null);

            pt.setStart(new JDFDate(JDFDate.ToMillisecs(DateTime.Now) + 3000000));
            pt.setEnd(new JDFDate(JDFDate.ToMillisecs(DateTime.Now) + 3100000));
            pt.appendEmployee().setPersonalID("Employee 3");
            pt.appendDevice().setDeviceID("Approval Device 1");
            iterRuli.setResStatus(EnumResStatus.Available, false);
            iterNode.setStatus(EnumNodeStatus.Suspended);
            iterNode.setAttribute("StatusDetails", ITERATION_PAUSED);
            iterAppSuccess.setResStatus(EnumResStatus.Available, true);
            iterDoc.write2File(getIteration(4), 2, false);
        }
Example #5
0
        ///
        ///	 <summary> * Append a PhaseTime audit element
        ///	 *  </summary>
        ///	 * <param name="phase"> the node status at this time </param>
        ///	 * <param name="by"> the author keyword </param>
        ///	 * <param name="vmParts"> defines a vector of map of parts for which the Spawned is valid </param>
        ///	 * <returns> the newly created PhaseTime audit
        ///	 *
        ///	 *         default: AddPhaseTime(phase, JDFConstants.EMPTYSTRING, new VJDFAttributeMap()) </returns>
        ///
        public virtual JDFPhaseTime addPhaseTime(EnumNodeStatus phase, string by, VJDFAttributeMap vmParts)
        {
            JDFPhaseTime myAudit = (JDFPhaseTime)addAudit(JDFAudit.EnumAuditType.PhaseTime, by);

            myAudit.setStatus(phase);
            myAudit.setStart(new JDFDate());
            myAudit.setEnd(new JDFDate());
            myAudit.setPartMapVector(vmParts);
            JDFNode parentJDF = getParentJDF();

            if (parentJDF != null)
            {
                myAudit.setSpawnID(StringUtil.getNonEmpty(parentJDF.getSpawnID(true)));
            }

            return(myAudit);
        }
Example #6
0
        public virtual void testModulesUpdate()
        {
            JDFAuditPool ap = n.getCreateAuditPool();

            ap.appendXMLComment("JDF 1.3 compatible auditing of module phases with updates", null);
            JDFPhaseTime   pt    = ap.addPhaseTime(EnumNodeStatus.Setup, null, null);
            JDFPhaseTime   pt2   = ap.addPhaseTime(EnumNodeStatus.InProgress, null, null);
            JDFPhaseTime   pt3   = ap.addPhaseTime(EnumNodeStatus.InProgress, null, null);
            JDFDate        date  = new JDFDate();
            JDFModulePhase mpRIP = pt.appendModulePhase();

            mpRIP.setModuleType("Imaging");
            JDFModulePhase mpJob = pt.appendModulePhase();

            mpJob.setModuleType("Manual");
            mpJob.setStatus(EnumNodeStatus.InProgress);
            JDFModulePhase mpPrint = pt.appendModulePhase();

            mpPrint.setModuleType("Printing");

            mpRIP.setStatus(EnumNodeStatus.InProgress);
            pt.setStart(date);
            mpRIP.setStart(date);
            date.addOffset(0, 5, 0, 0);
            pt.setEnd(date);

            pt2.copyElement(mpRIP, null);
            pt2.copyElement(mpJob, null);
            pt2.copyElement(mpPrint, null);
            mpPrint.setStatus(EnumNodeStatus.InProgress);
            pt2.setStart(date);
            mpPrint.setStart(date);
            date.addOffset(0, 30, 0, 0);
            mpRIP.setEnd(date);

            date.addOffset(0, 70, 0, 0);
            pt2.setEnd(date);
            mpPrint.setEnd(date);
            pt3.copyElement(mpRIP, null);
            pt3.copyElement(mpJob, null);
            pt3.copyElement(mpPrint, null);

            doc.write2File(sm_dirTestDataTemp + "DigiPrintModuleUpdate.jdf", 2, false);
        }
Example #7
0
        ///
        ///	 <summary> * finds all status messages in a jmf and fills the phaseTime with the appropriate data
        ///	 *  </summary>
        ///	 * <param name="jmf"> </param>
        ///	 * <returns> vector the vector of all modified phasetime elements </returns>
        ///
        public virtual VElement setPhase(JDFJMF jmf)
        {
            VElement vMessages = jmf.getMessageVector(null, EnumType.Status);

            if (vMessages == null)
            {
                return(null);
            }
            VElement vRet = new VElement();

            for (int i = 0; i < vMessages.Count; i++)
            {
                JDFMessage status   = (JDFMessage)vMessages[i];
                VElement   devInfos = status.getChildElementVector(ElementName.DEVICEINFO, null, null, true, 0, true);
                for (int j = 0; j < devInfos.Count; j++)
                {
                    JDFDeviceInfo devInfo = (JDFDeviceInfo)devInfos[j];
                    VElement      phases  = devInfo.getChildElementVector(ElementName.JOBPHASE, null, null, true, 0, true);
                    for (int k = 0; k < phases.Count; k++)
                    {
                        JDFJobPhase phase = (JDFJobPhase)phases[k];
                        string      jobID = phase.getJobID();
                        if (!jobID.Equals(getParentJDF().getJobID(true)))
                        {
                            continue;
                        }
                        string jobPartID = phase.getJobPartID();
                        if (!jobPartID.Equals(getParentJDF().getJobPartID(true)))
                        {
                            continue;
                        }

                        JDFPhaseTime pt = setPhase(phase.getStatus(), phase.getStatusDetails(), phase.getPartMapVector(), devInfo.getChildElementVector(ElementName.EMPLOYEE, null));
                        pt.copyElement(phase.getMISDetails(), null);
                        pt.setEnd(jmf.getTimeStamp());
                        pt.setStart(phase.getPhaseStartTime());
                        vRet.Add(pt);
                    }
                }
            }
            vRet.unify();
            return(vRet.Count == 0 ? null : vRet);
        }
Example #8
0
        private void iterateThird()
        {
            iterateRead(2);
            JDFPhaseTime pt = iterNode.getAuditPool().setPhase(EnumNodeStatus.InProgress, "Second Iteration Ongoing", null, null);

            pt.setStart(new JDFDate(JDFDate.ToMillisecs(DateTime.Now) + 2000000));
            pt.setEnd(new JDFDate(JDFDate.ToMillisecs(DateTime.Now) + 2100000));
            pt.appendEmployee().setPersonalID("Employee 1");
            pt.appendDevice().setDeviceID("Device 2");
            iterRuli.setResStatus(EnumResStatus.Unavailable, false);
            JDFResourceAudit ra = iterNode.cloneResourceToModify(iterNode.getLink(iterRuli, null));

            iterRuli = (JDFRunList)ra.getNewLink().getTarget();
            iterRuli.setResStatus(EnumResStatus.Draft, false);
            iterRuli.setFileURL(StringUtil.uncToUrl("C:\\local\\MyUpdatedInOutput.pdf", false));

            iterNode.setStatus(EnumNodeStatus.Suspended);
            iterNode.setAttribute("StatusDetails", ITERATION_PAUSED);
            iterDoc.write2File(getIteration(3), 2, false);
        }
Example #9
0
        public virtual void testModules()
        {
            JDFAuditPool ap = n.getCreateAuditPool();

            ap.appendXMLComment("JDF 1.3 compatible auditing of module phases - note that modulephase start and end times are set outside of the phasetime start and end times", null);
            JDFPhaseTime   pt     = ap.addPhaseTime(EnumNodeStatus.Setup, null, null);
            JDFPhaseTime   pt2    = ap.addPhaseTime(EnumNodeStatus.InProgress, null, null);
            JDFDate        date   = new JDFDate();
            JDFModulePhase mpRIP  = pt.appendModulePhase();
            JDFModulePhase mpRIP2 = pt2.appendModulePhase();

            mpRIP.setStatus(EnumNodeStatus.InProgress);
            mpRIP2.setStatus(EnumNodeStatus.InProgress);
            mpRIP2.setDescriptiveName("This ModulePhase is actually the same as the initial ModulePhase in the setup PhaseTime");
            mpRIP.setModuleType("Imaging");
            mpRIP2.setModuleType("Imaging");
            pt.setStart(date);
            mpRIP.setStart(date);
            mpRIP2.setStart(date);
            date.addOffset(0, 5, 0, 0);
            pt.setEnd(date);

            JDFModulePhase mpPrint = pt2.appendModulePhase();

            mpPrint.setStatus(EnumNodeStatus.InProgress);
            pt2.setStart(date);
            mpPrint.setStart(date);
            date.addOffset(0, 30, 0, 0);
            mpRIP.setEnd(date);
            mpRIP2.setEnd(date);

            date.addOffset(0, 70, 0, 0);
            pt2.setEnd(date);
            mpPrint.setEnd(date);
            mpPrint.setModuleType("Printer");
            doc.write2File(sm_dirTestDataTemp + "DigiPrintModule1.jdf", 2, false);
        }
Example #10
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);
            }
        }