コード例 #1
0
ファイル: StringUtilTest.cs プロジェクト: cip4/JDFLibNet
        public virtual void testGetNamesVector()
        {
            VString v = StringUtil.getNamesVector(EnumType.AbortQueueEntry.GetType());

            Assert.IsTrue(v.Contains("Resource"));
            v = StringUtil.getNamesVector(EnumOrientation.Flip0.GetType());
            Assert.IsTrue(v.Contains("Rotate90"));
        }
コード例 #2
0
        public virtual void testElementVersion()
        {
            VString vPrerelease = null;
            VString vOptional   = null;
            VString vDeprecated = null;

            JDFDoc  jdfDoc = new JDFDoc("JDF");
            JDFNode root   = jdfDoc.getJDFRoot();

            // check AdhesiveBindingParams/GlueApplication
            //
            root.setVersion(JDFElement.EnumVersion.Version_1_3);
            JDFAdhesiveBindingParams adhesiveBindingParam = (JDFAdhesiveBindingParams)root.addResource(ElementName.ADHESIVEBINDINGPARAMS, null, EnumUsage.Input, null, null, null, null);

            vDeprecated = adhesiveBindingParam.getTheElementInfo().deprecatedElements();
            adhesiveBindingParam.appendGlueApplication();
            vDeprecated = adhesiveBindingParam.getDeprecatedElements(99999999);
            Assert.IsTrue(vDeprecated.Contains(ElementName.GLUEAPPLICATION));

            root.setVersion(JDFElement.EnumVersion.Version_1_0);
            vDeprecated = adhesiveBindingParam.getDeprecatedElements(99999999);
            Assert.AreEqual(0, vDeprecated.Count);

            // check MarkObject/DeviceMark
            //
            root.setVersion(JDFElement.EnumVersion.Version_1_0);
            JDFLayout     layout     = (JDFLayout)root.addResource(ElementName.LAYOUT, null, EnumUsage.Input, null, null, null, null);
            JDFMarkObject markObject = layout.appendMarkObject();

            markObject.appendDeviceMark();
            vPrerelease = markObject.getPrereleaseElements(99999999);
            Assert.IsTrue(vPrerelease.Contains(ElementName.DEVICEMARK));

            root.setVersion(JDFElement.EnumVersion.Version_1_1);
            vOptional = markObject.getTheElementInfo().optionalElements();
            Assert.IsTrue(vOptional.Contains(ElementName.DEVICEMARK));

            root.setVersion(JDFElement.EnumVersion.Version_1_2);
            vOptional = markObject.getTheElementInfo().optionalElements();
            Assert.IsTrue(vOptional.Contains(ElementName.DEVICEMARK));

            root.setVersion(JDFElement.EnumVersion.Version_1_3);
            vDeprecated = markObject.getTheElementInfo().deprecatedElements();
            Assert.IsTrue(vDeprecated.Contains(ElementName.DEVICEMARK));
        }
コード例 #3
0
ファイル: MISPreGoldenTicket.cs プロジェクト: cip4/JDFLibNet
        ///
        ///	 <summary> *  </summary>
        ///

        ///
        ///	 <summary> *  </summary>
        ///
        private void makeReadyPreviewGeneration()
        {
            VString v = theExpandedNode.getAllTypes();

            if (v != null && v.Contains(EnumType.PreviewGeneration.getName()))
            {
                JDFPreviewGenerationParams pgp = (JDFPreviewGenerationParams)theExpandedNode.getCreateResource(ElementName.PREVIEWGENERATIONPARAMS, EnumUsage.Input, 0);
                pgp.setPreviewUsage(JDFPreviewGenerationParams.EnumPreviewUsage.Separation);
            }
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
ファイル: MISPreGoldenTicket.cs プロジェクト: cip4/JDFLibNet
        ///
        ///	 <summary> *  </summary>
        ///
        private void linkPrepressPrepRunLists()
        {
            VElement vprepreviousNode = theNode.getJDFRoot().getvJDFNode(null, null, false);

            if (vprepreviousNode != null && vprepreviousNode.Count > 0)
            {
                for (int i = 0; i < vprepreviousNode.Count; i++)
                {
                    JDFNode node  = (JDFNode)vprepreviousNode[i];
                    VString types = node.getTypes();
                    if (types != null && types.Contains("PrePressPreparation"))
                    {
                        theNode.linkOutputs(node);
                    }
                }
            }
        }
コード例 #6
0
        //
        //	 * (non-Javadoc)
        //	 *
        //	 * @see
        //	 * org.cip4.jdflib.core.JDFElement#getInvalidAttributes(org.cip4.jdflib.
        //	 * core.KElement.EnumValidationLevel, boolean, int)
        //
        public override VString getInvalidAttributes(EnumValidationLevel level, bool bIgnorePrivate, int nMax)
        {
            VString vs = base.getInvalidAttributes(level, bIgnorePrivate, nMax);

            if (nMax > 0 && vs.Count > nMax)
            {
                return(vs);
            }
            if (!EnumValidationLevel.RecursiveComplete.Equals(level) && !EnumValidationLevel.RecursiveIncomplete.Equals(level))
            {
                return(vs);
            }
            if (vs.Contains(AttributeName.DEVCAPREF))
            {
                return(vs);
            }

            if (hasAttribute(AttributeName.DEVCAPREF))
            {
                JDFDevCapPool devCapPool = getDevCapPool();
                if (devCapPool == null)
                {
                    vs.Add(AttributeName.DEVCAPREF);
                    return(vs);
                }
                VString idRefs = getDevCapRef();
                for (int i = 0; i < idRefs.Count; i++)
                {
                    JDFDevCap devCap = devCapPool.getDevCap(idRefs.stringAt(i));
                    if (devCap == null)
                    {
                        vs.Add(AttributeName.DEVCAPREF);
                        return(vs);
                    }
                }
            }
            return(vs);
        }
コード例 #7
0
        public virtual VString copyResource(JDFResource r, JDFResource.EnumSpawnStatus copyStatus, VJDFAttributeMap vParts, string spawnID)
        {
            VString ss = getResIds();
            VString v  = new VString();

            // r is not yet here copy r
            if (!ss.Contains(r.getID()))
            {
                JDFResource rNew = null;
                // if spawning, fix stati and locks
                if (copyStatus == JDFResource.EnumSpawnStatus.SpawnedRO)
                {
                    // copy the complete resource as RO - no need to reduce
                    // partitions
                    r.appendSpawnIDs(spawnID);
                    rNew = (JDFResource)copyElement(r, null);
                    rNew.setLocked(true);
                    r.setSpawnStatus(copyStatus);
                }
                else if (copyStatus == JDFResource.EnumSpawnStatus.SpawnedRW)
                {
                    if (vParts.Count == 0)
                    { // just copy the whole thing - no parts specified
                        r.appendSpawnIDs(spawnID);
                        rNew = (JDFResource)copyElement(r, null);
                        r.setSpawnStatus(copyStatus);
                    }
                    else
                    {
                        rNew = (JDFResource)copyElement(r, null);
                        rNew.reducePartitions(vParts);
                        // reduce any unneeded leaves
                        // loop over all part maps to get best matching resource
                        for (int i = 0; i < vParts.Count; i++)
                        {
                            JDFResource pLeaf    = r.getPartition(vParts[i], null);
                            JDFResource pNewLeaf = rNew.getPartition(vParts[i], null);
                            if (pLeaf != null)
                            {
                                pLeaf.setSpawnStatus(copyStatus);
                                pLeaf.appendSpawnIDs(spawnID);
                            }
                            if (pNewLeaf != null)
                            {
                                pNewLeaf.appendSpawnIDs(spawnID);
                            }
                        }
                    }
                }

                if (rNew != null)
                {
                    v.Add(rNew.getID());
                }
            }

            VString vs = r.getHRefs(null, false, true);

            // add recursively copied resources
            for (int i = 0; i < vs.Count; i++)
            {
                string id = vs[i];
                // the referenced resource is in this pool - continue
                if (ss.Contains(id))
                {
                    continue;
                }

                // the referenced resource has already been merged in - continue
                if (v.Contains(id))
                {
                    continue;
                }

                JDFResource next = (JDFResource)getDocRoot().getTarget(id, AttributeName.ID);
                if (next == null)
                {
                    // 071101 RP added r is by definition in the original document
                    // which also contains the rrefs elements
                    next = (JDFResource)r.getDocRoot().getTarget(id, AttributeName.ID);
                    // and now all those interlinked resources
                    VString vv = copyResource(next, copyStatus, vParts, spawnID);
                    v.AddRange(vv);
                }
            }

            return(v);
        }