コード例 #1
0
        ///
        ///	 <summary> * return the jmf root of the status jmf that contains all modules, null if no modules are active
        ///	 *
        ///	 * @return </summary>
        ///
        public virtual JDFDoc getStatusResponse()
        {
            if (counters.Count == 0)
            {
                return(null);
            }

            StatusCounter root = counters[0];
            JDFDoc        d    = new JDFDoc("JMF");
            JDFJMF        jmf  = d.getJMFRoot();

            jmf.mergeElement(root.getDocJMFPhaseTime().getJMFRoot(), false);
            JDFDeviceInfo di = jmf.getResponse(0).getDeviceInfo(0);

            for (int i = 1; i < counters.Count; i++)
            {
                StatusCounter counter         = counters[i];
                JDFDoc        docJMFPhaseTime = counter.getDocJMFPhaseTime();
                if (docJMFPhaseTime == null)
                {
                    continue;
                }
                JDFDeviceInfo di2    = docJMFPhaseTime.getJMFRoot().getResponse(0).getDeviceInfo(0);
                VElement      phases = di2.getChildElementVector(ElementName.JOBPHASE, null, null, true, -1, false);
                for (int j = 0; j < phases.Count; j++)
                {
                    di.copyElement(phases[j], null);
                }
                di.setDeviceStatus(getDeviceStatus());
            }
            return(d);
        }
コード例 #2
0
ファイル: JDFAuditPool.cs プロジェクト: cip4/JDFLibNet
        ///
        ///	 <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);
        }