Exemple #1
0
            internal LinkAmount(StatusUtil pEnclosingInstance, JDFResourceLink _rl)
            {
                enclosingInstance = pEnclosingInstance;

                JDFNode dump = new JDFDoc("JDF").getJDFRoot();

                dump.appendResourceLinkPool().copyElement(_rl, null);
                dump.appendResourcePool().copyElement(_rl.getTarget(), null);
                rl = (JDFResourceLink)dump.getResourceLinkPool().getElement(_rl.Name, null, 0);
                JDFAttributeMap map = (enclosingInstance.m_vPartMap == null || enclosingInstance.m_vPartMap.Count == 0) ? null : enclosingInstance.m_vPartMap[0];

                startAmount = rl.getAmount(map);
                if (startAmount == -1)
                {
                    map = new JDFAttributeMap(map);
                    map.put(EnumPartIDKey.Condition, "Good");
                    startAmount = rl.getAmount(map);
                    if (startAmount == -1)
                    {
                        startAmount = 0;
                    }
                    map.put(EnumPartIDKey.Condition, "Waste");
                    startWaste = rl.getAmount(map);
                    if (startWaste == -1)
                    {
                        startWaste = 0;
                    }
                }
            }