/// /// <summary> * check whether the partition values match /// * </summary> /// * <param name="key"> the partition key </param> /// * <param name="resourceValue"> the value of key in the resource </param> /// * <param name="linkValue"> the value of key in the part element or ref </param> /// * <returns> boolean: true if linkValue matches the value or list in resourceValue /// * </returns> /// public static bool matchesPart(string key, string resourceValue, string linkValue) { EnumPartIDKey eKey = EnumPartIDKey.getEnum(key); if (eKey == null) { return(resourceValue.Equals(linkValue)); } bool b; // EnumPartIDKey.PartVersion.equals(eKey) if (EnumPartIDKey.DocTags.Equals(eKey) || EnumPartIDKey.ItemNames.Equals(eKey) || EnumPartIDKey.PageTags.Equals(eKey) || EnumPartIDKey.RunTags.Equals(eKey) || EnumPartIDKey.SetTags.Equals(eKey)) { b = StringUtil.matchesAttribute(linkValue, resourceValue, AttributeInfo.EnumAttributeType.NMTOKENS); } else if (EnumPartIDKey.DocCopies.Equals(eKey) || EnumPartIDKey.DocIndex.Equals(eKey) || EnumPartIDKey.DocRunIndex.Equals(eKey) || EnumPartIDKey.DocSheetIndex.Equals(eKey) || EnumPartIDKey.LayerIDs.Equals(eKey) || EnumPartIDKey.PageNumber.Equals(eKey) || EnumPartIDKey.RunIndex.Equals(eKey) || EnumPartIDKey.SectionIndex.Equals(eKey) || EnumPartIDKey.SetIndex.Equals(eKey) || EnumPartIDKey.SetRunIndex.Equals(eKey) || EnumPartIDKey.SetSheetIndex.Equals(eKey) || EnumPartIDKey.SheetIndex.Equals(eKey)) { b = StringUtil.matchesAttribute(linkValue, resourceValue, AttributeInfo.EnumAttributeType.IntegerRangeList); } else { b = resourceValue.Equals(linkValue); } return(b); }
public virtual void testPartIDConsistency() { JDFDoc doc = new JDFDoc("Part"); JDFPart p = (JDFPart)doc.getRoot(); VString knownAtts = p.knownAttributes(); IEnumerator it = EnumPartIDKey.iterator(); while (it.MoveNext()) { string name = ((EnumPartIDKey)it.Current).getName(); Assert.IsTrue(knownAtts.Contains(name), "name missing in Part: " + name); } }
/// /// <summary> * gets a map of all Partition key value pairs, empty if no partition keys exist /// * </summary> /// * <returns> JDFAttributeMap </returns> /// public override JDFAttributeMap getPartMap() { JDFAttributeMap am = getAttributeMap(); IEnumerator <string> it = am.Keys.GetEnumerator(); JDFAttributeMap retMap = new JDFAttributeMap(); while (it.MoveNext()) { string key = it.Current; if (EnumPartIDKey.getEnum(key) != null) { retMap.put(key, am.get(key)); } } return(retMap); }
/// /// <summary> * create 2 sheets with 2 surfaces of 4 seps each </summary> /// private void setup(EnumPartIDKey scheduleDepth, int nSheet) { VJDFAttributeMap vMap = new VJDFAttributeMap(); JDFAttributeMap map = new JDFAttributeMap(); map.put(EnumPartIDKey.SignatureName, "Sig1"); for (int i = 1; i <= nSheet; i++) { map.put(EnumPartIDKey.SheetName, "Sheet" + i); map.put(EnumPartIDKey.Side, "Front"); vMap.Add(new JDFAttributeMap(map)); map.put(EnumPartIDKey.Side, "Back"); vMap.Add(new JDFAttributeMap(map)); } bgt = new MISCPGoldenTicket(1, null, 2, 1, true, vMap); if (scheduleDepth != null) { // TODO lower } bgt.nCols[0] = bgt.nCols[1] = 4; bgt.assign(null); node = bgt.getNode(); }
/// /// <summary> * constructor: create a new map with one entry that is defined by partIDKey, value /// * </summary> /// * <param name="partIDKey"> the enumerated partIDKey </param> /// * <param name="value"> the partition key value </param> /// public JDFAttributeMap(EnumPartIDKey partIDKey, string value) : this(partIDKey.getName(), value) { }