示例#1
0
文件: RIPTest.cs 项目: cip4/JDFLibNet
        public virtual void testReprintJMF()
        {
            testAuditsImageSetting();
            statCounter.setActiveNode(null, null, null);
            string           sheet        = vsSheet.stringAt(1);
            VJDFAttributeMap vmP          = new VJDFAttributeMap();
            JDFAttributeMap  attributeMap = new JDFAttributeMap(EnumPartIDKey.SheetName, sheet);

            attributeMap.put("SignatureName", "Sig1");
            attributeMap.put("Separation", vsCMYK.stringAt(3));
            attributeMap.put("Side", "Front");

            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.setActiveNode(n, vmP, vRL);
            statCounter.setWorkType(EnumWorkType.Rework);
            statCounter.setPhase(EnumNodeStatus.InProgress, "Imaging", EnumDeviceStatus.Running, null);
            statCounter.addPhase(refMedia, 1, 0, true);
            statCounter.addPhase(refXM, 1, 0, true);
            statCounter.setPhase(EnumNodeStatus.InProgress, "Imaging", EnumDeviceStatus.Running, null);
            JDFDoc d2  = statCounter.getDocJMFResource();
            JDFJMF jmf = d2.getJMFRoot();

            jmf.convertResponses(null);
            VElement vSigs = jmf.getMessageVector(JDFMessage.EnumFamily.Signal, JDFMessage.EnumType.Resource);

            d2.write2File(sm_dirTestDataTemp + "ImageSetResourceReprint_.jmf", 2, false);
            JDFDoc dStatusJMF = statCounter.getDocJMFPhaseTime();

            jmf = dStatusJMF.getJMFRoot();
            jmf.convertResponses(null);
            for (int i = 0; i < vSigs.Count; i++)
            {
                jmf.copyElement(vSigs.item(i), null);
            }
            dStatusJMF.write2File(sm_dirTestDataTemp + "ImageSetReprint_.jmf", 2, false);

            // JDFResourceAudit ra=
            statCounter.setResourceAudit(refMedia, EnumReason.ProcessResult);
            // JDFProcessRun pr=
            statCounter.setProcessResult(EnumNodeStatus.Completed);

            d.write2File(sm_dirTestDataTemp + "ImageSetAmount_Reprint.jdf", 2, false);
        }
示例#2
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);
        }