Пример #1
0
        ///
        ///	 <summary> * get matching part status vector
        ///	 *  </summary>
        ///	 * <param name="JDFAttributeMap"> mPart </param>
        ///	 * <returns> VElement - vector of JDFPartStatus </returns>
        ///
        public virtual VElement getMatchingPartStatusVector(JDFAttributeMap mPart)
        {
            VElement vPartStatus = getChildElementVector(ElementName.PARTSTATUS, null, null, true, 0, false);
            VElement vPS         = new VElement();

            for (int i = 0; i < vPartStatus.Count; i++)
            {
                JDFPartStatus   ps      = (JDFPartStatus)vPartStatus[i];
                JDFAttributeMap mapPart = ps.getPartMap();

                if (mapPart.subMap(mPart))
                {
                    vPS.Add(ps); // mPart is a subset of of mapPart
                }
            }
            return(vPS);
        }
Пример #2
0
        ///
        ///	 <summary> * getPartStatus - get a PartStatus that fits to the filter defined by mPart
        ///	 *  </summary>
        ///	 * <param name="mPart"> the filter for the part to set the status
        ///	 *  </param>
        ///	 * <returns> JDFPartStatus - the PartStatus that fits </returns>
        ///
        public virtual JDFPartStatus getPartStatus(JDFAttributeMap mPart)
        {
            VElement      vPartStatus   = getChildElementVector(ElementName.PARTSTATUS, null, null, true, 0, false);
            int           nSep          = 0;
            JDFPartStatus retPartStatus = null;

            for (int i = vPartStatus.Count - 1; i >= 0; i--)
            {
                JDFPartStatus   ps      = (JDFPartStatus)vPartStatus[i];
                JDFAttributeMap mapPart = ps.getPartMap();

                if (mPart != null && mPart.subMap(mapPart))
                {
                    if (mapPart.Count > nSep)
                    {
                        nSep          = mapPart.Count;
                        retPartStatus = ps; // mPart is a subset of of mapPart
                    }
                }
            }

            return(retPartStatus);
        }