Пример #1
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);
        }