/// /// <summary> * </summary> /// private void executeLayout() { JDFLayout lo = (JDFLayout)theExpandedNode.getResource(ElementName.LAYOUT, EnumUsage.Output, 0); if (lo != null && vParts != null) { VJDFAttributeMap reducedMap = getReducedMap(new VString("Separation PartVersion", " ")); lo.setResStatus(EnumResStatus.Available, true); if (reducedMap != null) { int size = reducedMap.Count; for (int i = 0; i < size; i++) { JDFAttributeMap part = reducedMap[i]; if (bSingleSided == true && "Back".Equals(part.get("Side"))) { continue; } JDFLayout partLO = (JDFLayout)lo.getCreatePartition(part, partIDKeys); for (int j = 0; j < 4; j++) { JDFContentObject co = partLO.appendContentObject(); co.setCTM(new JDFMatrix(1 + 10 * j, 2 + 20 * j, 3 + 30 * j, 4 + 40 * j, 5 + 50 * j, 6 + 0 * j)); co.setOrd(j + i * 4); } } } } }
/// /// * <param name="icsLevel"> </param> /// protected internal virtual void initPreviewSep() { if (theParentNode != null) { theNode.ensureLink(theParentNode.getResource(ElementName.PREVIEW, EnumUsage.Output, 0), EnumUsage.Output, null); } JDFPreview pv = (JDFPreview)theNode.getCreateResource(ElementName.PREVIEW, EnumUsage.Output, 0); pv.setResStatus(EnumResStatus.Incomplete, false); pv.setPreviewUsage(EnumPreviewUsage.Separation); pv.setPartUsage(EnumPartUsage.Explicit); pv.setPreviewFileType(EnumPreviewFileType.PNG); if (vParts != null) { for (int i = 0; i < vParts.Count; i++) { JDFAttributeMap part = vParts[i]; JDFPreview pvp = (JDFPreview)pv.getCreatePartition(part, partIDKeys); int ncols = "Front".Equals(part.get("Side")) ? nCols[0] : nCols[1]; for (int j = 0; j < ncols; j++) { pvp.getCreatePartition(EnumPartIDKey.Separation, cols.stringAt(j), partIDKeys); pvp.setResStatus(EnumResStatus.Incomplete, false); } } } }
/// /// <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> * fitsMap - tests whether attribute map 'm' has a key specified by /// * BasicPreflightTest/@Name. If this the case, it is checked whether its /// * value fits the testlist. /// * </summary> /// * <param name="m"> /// * key-value pair attribute map to take the value from </param> /// * <returns> boolean - true, if 'm' has a key specified by BasicPreflightTest/@Name /// * and fitsValue(value) returns true </returns> /// public override sealed bool fitsMap(JDFAttributeMap m) { JDFBasicPreflightTest basicPreflightTest = getBasicPreflightTest(); if (basicPreflightTest == null) { return(false); } string n = basicPreflightTest.getName(); if (m.ContainsKey(n)) { string val = m.get(n); return(fitsValue(val)); } return(false); // __Lena__ ? false or smth else }
/// /// <summary> * overlapMap - identical keys must have the same values in both maps<br> /// * similar to JDFAttribute.overlapMap, but uses matchesPart instead of equals for the comparison /// * </summary> /// * <param name="subMap"> the map to compare /// * </param> /// * <returns> boolean: true if identical keys have the same values in both maps </returns> /// public static bool overlapPartMap(JDFAttributeMap resourceMap, JDFAttributeMap linkMap) { if ((resourceMap == null) || (linkMap == null)) { return(true); // null always overlaps with anything } IEnumerator <string> subMapEnum = linkMap.getKeyIterator(); while (subMapEnum.MoveNext()) { string key = (string)subMapEnum.Current; string resVal = resourceMap.get(key); if (resVal != null) { string linkVal = linkMap.get(key); if (!matchesPart(key, resVal, linkVal)) { return(false); } } } return(true); }
/// /// <summary> * apply the parameters in this to all appropriate resources in parentNode or one of parentNode's children /// * </summary> /// * <param name="parentNode"> the node to search in </param> /// internal virtual void applyResourceCommand(JDFNode parentNode) { if (parentNode == null) { return; } VElement vNodes = parentNode.getvJDFNode(null, null, false); int size = vNodes.Count; for (int i = 0; i < size; i++) { JDFNode node = (JDFNode)vNodes[i]; if (!matchesNode(node)) { continue; } JDFResource resCmd = enclosingInstance.getResource(null); if (resCmd == null) { continue; } bool isIncremental = (enclosingInstance.getUpdateMethod() == EnumUpdateMethod.Incremental); // commented out, statements have no effect // double dAmount = -1.0; // if (hasAttribute (AttributeName.PRODUCTIONAMOUNT)) // { // dAmount = getProductionAmount (); // TODO: set ProductionAmount // } // final String strProcessUsage = getProcessUsage(); // TODO: use // ProcessUsage // final JDFElement.EnumNodeStatus status = getStatus(); // TODO: // set Status VJDFAttributeMap vamParts = enclosingInstance.getPartMapVector(); JDFResource resTarget = getTargetResource(node); if (resTarget == null) { resTarget = createNewResource(node, resCmd); if (resTarget == null) { continue; } } // get the most granular list of partIDKeys from the cmd or resource VString vsPartIDKeys = resTarget.getPartIDKeys(); VString vsPartIDKeysCmd = resCmd.getPartIDKeys(); int sizTarget = vsPartIDKeys == null ? 0 : vsPartIDKeys.Count; int sizCmd = vsPartIDKeysCmd == null ? 0 : vsPartIDKeysCmd.Count; if (sizCmd > sizTarget) { vsPartIDKeys = vsPartIDKeysCmd; } int sizeParts = vamParts == null ? 1 : vamParts.Count; for (int j = 0; j < sizeParts; j++) { JDFAttributeMap amParts = vamParts == null ? null : vamParts[j]; JDFResource resTargetPart = resTarget.getCreatePartition(amParts, vsPartIDKeys); if (resTargetPart == null) { continue; } string id = resTargetPart.getID(); if (!isIncremental) { JDFAttributeMap map = resTargetPart.getPartMap(); resTargetPart.flush(); resTargetPart.setAttributes(map); } JDFResource resCmdPart = resCmd.getPartition(amParts, EnumPartUsage.Implicit); JDFAttributeMap map2 = resCmdPart.getAttributeMap(); VString keys = map2.getKeys(); if (keys != null) { int keySize = keys.Count; for (int k = 0; k < keySize; k++) { string key = keys[k]; string @value = map2.get(key); if (@value == null || JDFConstants.EMPTYSTRING.Equals(@value)) { resCmdPart.removeAttribute(key); resTargetPart.removeAttribute(key); } } } resTargetPart.mergeElement(resCmdPart, false); resTarget.setID(id); } if (sizeParts > 0 && resTarget is JDFNodeInfo) { fixNodeStatusFromNodeInfo(node, resTarget); } } }
/// /// * <param name="icsLevel"> </param> /// protected internal virtual void initPlateXM(EnumUsage usage) { JDFResourceLink rl = null; if (thePreviousNode != null) // either input (for cp, or output for // plateset) { rl = theNode.linkResource(thePreviousNode.getResource(ElementName.EXPOSEDMEDIA, null, 0), usage, null); } if (rl == null && theParentNode != null) { rl = theNode.ensureLink(theParentNode.getResource(ElementName.EXPOSEDMEDIA, null, 0), usage, null); } JDFExposedMedia xm = (JDFExposedMedia)theNode.getCreateResource(ElementName.EXPOSEDMEDIA, usage, 0); xm.setPartUsage(EnumPartUsage.Explicit); rl = theNode.getLink(xm, null); JDFMedia m = ((JDFExposedMedia)xm.getLeaves(false)[0]).getMedia(); if (m == null) { m = initPlateMedia(); } else { m = (JDFMedia)m.getResourceRoot(); if (theParentNode != null) { theNode.ensureLink(theParentNode.getResource("Media", EnumUsage.Input, 0), EnumUsage.Input, null); } } xm.setResStatus(EnumResStatus.Unavailable, false); if (!bPartitionedPlateMedia && xm.getMedia() == null) { xm.refElement(m); } if (EnumUsage.Input.Equals(usage)) { rl.setProcessUsage(EnumProcessUsage.Plate); JDFResourceLink link = theNode.getLink(m, null); if (link != null) { link.deleteNode(); } } if (vParts != null) { for (int i = 0; i < vParts.Count; i++) { JDFAttributeMap part = new JDFAttributeMap(vParts[i]); JDFResource xmp = xm.getCreatePartition(part, partIDKeys); int ncols = "Front".Equals(part.get("Side")) ? nCols[0] : nCols[1]; for (int j = 0; j < ncols; j++) { part.put(EnumPartIDKey.Separation, cols.stringAt(j)); xmp.getCreatePartition(part, partIDKeys); } } if (bPartitionedPlateMedia) { VJDFAttributeMap vSheets = getReducedMap(new VString("Side Separation PartVersion", null)); for (int i = 0; i < vSheets.Count; i++) { JDFAttributeMap part = new JDFAttributeMap(vSheets[i]); JDFExposedMedia xmp = (JDFExposedMedia)xm.getCreatePartition(part, partIDKeys); if (xmp.getMedia() == null) { xmp.refMedia((JDFMedia)m.getCreatePartition(part, null)); } } } } }