/// /// <summary> * does this ColorPool have Color elements with identical Name or RawName /// * eattributes return false if no Color elements with identical Name or /// * RawName tags exist </summary> /// public virtual VString getDuplicateColors() { VElement v = getChildElementVector(ElementName.COLOR, null, null, true, 0, false); SupportClass.HashSetSupport <string> vName = new SupportClass.HashSetSupport <string>(); int nCols = v.Count; VString vRet = new VString(); for (int i = 0; i < nCols; i++) { JDFColor color = (JDFColor)v[i]; string colorName = color.getName(); if (vName.Contains(colorName)) { vRet.appendUnique(colorName); } string rawName = color.get8BitName(); if (vName.Contains(rawName)) { vRet.appendUnique(colorName); } vName.Add(colorName); vName.Add(rawName); } return(vRet.Count == 0 ? null : vRet); }
/// /// <summary> * Typesafe attribute adder of rRefsRWCopied /// * </summary> /// * <param name="KString"> & rRefs the reference list </param> /// public virtual void appendrRefsRWCopied(VString rRefs) { VString v0 = getrRefsRWCopied(); v0.appendUnique(rRefs); setrRefsRWCopied(v0); }
public virtual VString findQueueEntries(string strJobID, string strJobPartID, VJDFAttributeMap vamParts, EnumQueueEntryStatus status) { VString vsQEntryIDs = new VString(); int entryCount = getEntryCount(); for (int i = 0; i < entryCount; i++) { JDFQueueEntry entry = getQueueEntry(i); string strQEJobID = entry.getJobID(); string strQEJobPartID = entry.getJobPartID(); VJDFAttributeMap vamQEParts = entry.getPartMapVector(); EnumQueueEntryStatus statusQE = entry.getQueueEntryStatus(); if (strJobID.Equals(strQEJobID) && strJobPartID.Equals(strQEJobPartID) && vamParts.Equals(vamQEParts)) { if ((status == null) || (status.Equals(statusQE))) { vsQEntryIDs.appendUnique(entry.getQueueEntryID()); } } } return(vsQEntryIDs); }
/// /// <summary> * add the type of amount link for resource audits etc /// * </summary> /// * <param name="link"> </param> /// public virtual void addAmountLink(string link) { if (amountLinks == null) { amountLinks = new VString(); } amountLinks.appendUnique(link); }
// // * (non-Javadoc) // * // * @see // * org.cip4.jdflib.core.JDFElement#getInvalidAttributes(org.cip4.jdflib. // * core.KElement.EnumValidationLevel, boolean, int) // protected internal virtual VString getInvalidAttributesImpl(EnumValidationLevel level, bool bIgnorePrivate, int nMax) { VString v = base.getInvalidAttributes(level, bIgnorePrivate, nMax); if (nMax > 0 && v.Count >= nMax) { return(v); } if (!fitsListType(getAttribute(AttributeName.DEFAULTVALUE))) { v.appendUnique(AttributeName.DEFAULTVALUE); } if (!fitsListType(getAttribute(AttributeName.CURRENTVALUE))) { v.appendUnique(AttributeName.CURRENTVALUE); } return(v); }
public override VString getMissingElements(int nMax) { VString v = base.getMissingElements(nMax); if (v.Count >= nMax) { return(v); } v.appendUnique(getMissingTerms(1)); return(v); }
public override VString getInvalidElements(EnumValidationLevel level, bool bIgnorePrivate, int nMax) { VString vElem = new VString(); int n = 0; int nElem = numChildElements(ElementName.FILESPEC, null); for (int i = 0; i < nElem; i++) { string ru = getFileSpec(i).getResourceUsage(); if (!ru.Equals("SearchPath")) { vElem.appendUnique(ElementName.FILESPEC); if (++n >= nMax) { return(vElem); } break; } } vElem.appendUnique(getInvalidElements(level, bIgnorePrivate, (nMax - n))); return(vElem); }
/// /// <summary> * Get a list of all separation names in the SeparationSpec elements /// * </summary> /// * <returns> the vector of separation names </returns> /// public virtual VString getSeparations() { VString vName = new VString(); VElement v = getChildElementVector(ElementName.SEPARATIONSPEC, null, null, false, 0, false); int nSep = v.Count; for (int i = 0; i < nSep; i++) { JDFSeparationSpec sep = (JDFSeparationSpec)v[i]; string sepName = sep.getName(); vName.appendUnique(sepName); } return(vName); }
protected internal virtual VString getInvalidTerms(int iMax) { VElement v = getTermVector(null); int vSize = v.Count; VString v2 = new VString(); if (vSize > iMax) // no more than iMax { for (int i = 0; i < vSize; i++) { string strName = v.item(i).LocalName; v2.appendUnique(strName); } } return(v2); }
public virtual void testGetRandomString() { VString v = new VString(); for (int i = 0; i < 1000; i++) { string s = StringUtil.getRandomString(); if (i % 100 == 0) { Console.WriteLine(s); } v.appendUnique(s); Assert.IsTrue(s.Length > 1); } Assert.IsTrue(v.Count < 100, "should be many different"); Assert.IsTrue(v.Count > 5); }
public override VString getInvalidElements(EnumValidationLevel level, bool bIgnorePrivate, int nMax) { bool bIgnorePrivateLocal = bIgnorePrivate; if (bIgnorePrivateLocal) { bIgnorePrivateLocal = false; // dummy to fool compiler } VString v = base.getInvalidElements(level, bIgnorePrivateLocal, nMax); if (v.Count >= nMax) { return(v); } v.appendUnique(getInvalidTerms(1)); return(v); }
/// /// <summary> * get the list of separations that this colorantcontrol describes adds the /// * separations that are implied by ProcessColorModel /// * </summary> /// * <returns> VString the complete list of process and spot colors </returns> /// public virtual VString getSeparations() { VString vName = new VString(); string model = getProcessColorModel(); if ("DeviceCMY".Equals(model)) { vName.Add("Cyan"); vName.Add("Magenta"); vName.Add("Yellow"); } else if ("DeviceCMYK".Equals(model)) { vName.Add("Cyan"); vName.Add("Magenta"); vName.Add("Yellow"); vName.Add("Black"); } else if ("DeviceGray".Equals(model)) { vName.Add("Black"); } else if ("DeviceRGB".Equals(model)) { vName.Add("Red"); vName.Add("Green"); vName.Add("Blue"); } else if ("DeviceN".Equals(model)) { vName = getDeviceNSpace(0).getSeparations(); } JDFSeparationList colpar = getColorantParams(); if (colpar != null) { vName.appendUnique(colpar.getSeparations()); } vName.unify(); return(vName); }
public override VString getInvalidElements(EnumValidationLevel level, bool bIgnorePrivate, int nMax) { bool bIgnorePrivateLocal = bIgnorePrivate; if (bIgnorePrivateLocal) { bIgnorePrivateLocal = false; // dummy to fool compiler } VString v = base.getInvalidElements(level, bIgnorePrivateLocal, nMax); if (v.Count >= nMax) { return(v); } VElement v2 = getChildElementVector_KElement(null, null, null, true, 0); int n = 0; int size = v2.Count; for (int i = 0; i < size; i++) { if (v2[i] is JDFRefElement) { n++; } } if (n > 1) { for (int i = 0; i < size; i++) { if (v2[i] is JDFRefElement) { v.appendUnique(v2[i].LocalName); } } } return(v); }
/// /// <summary> * Method getInvalidElements /// * <p> /// * default: GetInvalidElements(level, true, 999999) /// * </summary> /// * <param name="level"> validation level </param> /// * <param name="bIgnorePrivate"> </param> /// * <param name="nMax"> maximum number of elements to get /// * </param> /// * <returns> VString - vector of names of invalid elements </returns> /// public override VString getInvalidElements(EnumValidationLevel level, bool bIgnorePrivate, int nMax) { VString s = getInvalidElements_JDFElement(level, bIgnorePrivate, nMax); if (s.Count > nMax || hasAttribute(AttributeName.RESOURCENAME)) // multiple // are // allowed // with // resourcename // set { return(s); } VElement v = getChildElementVector(null, null, null, true, 0, false); int size = v.Count; if (size > 1) { // remove anything but resources for (int i = size - 1; i >= 0; i--) { if (!(v[i] is JDFResource)) { v.RemoveAt(i); } } size = v.Count; // must refresh size due to removes // more than one resource --> evil! if (size > 1) { for (int j = 0; j < size; j++) { s.appendUnique(v.item(j).LocalName); } } } return(s); }