Beispiel #1
0
        public virtual void testDirectImage()
        {
            JDFElement.setLongID(false);
            doc  = new JDFDoc("JDF");
            node = doc.getJDFRoot();
            node.setType(EnumType.Combined);
            VString vTypes = new VString("ImageSetting ConventionalPrinting", " ");

            node.setTypes(vTypes);
            nodeInfo = node.appendNodeInfo();
            nodeInfo.setResStatus(EnumResStatus.Available, true);
            JDFRunList rl = (JDFRunList)node.appendMatchingResource(ElementName.RUNLIST, EnumProcessUsage.AnyInput, null);
            JDFByteMap bm = rl.appendByteMap();

            bm.appendFileSpec().setURL("FileInfo:///foo.tif");
            JDFExposedMedia xm = (JDFExposedMedia)node.appendMatchingResource(ElementName.EXPOSEDMEDIA, EnumProcessUsage.Plate, null);

            xm.setDescriptiveName("Real Plate");
            xm.appendMedia();
            JDFExposedMedia xmCyl = (JDFExposedMedia)node.appendMatchingResource(ElementName.EXPOSEDMEDIA, EnumProcessUsage.Cylinder, null);

            xmCyl.setDescriptiveName("Optional cylinder");
            node.linkMatchingResource(xmCyl, EnumProcessUsage.AnyOutput, null);
            Assert.AreEqual(3, node.getResourceLinkPool().numChildElements("ExposedMediaLink", null), "2 for cylinder one for plate");
            doc.write2File(sm_dirTestDataTemp + "webDirect.jdf", 2, false);
        }
Beispiel #2
0
        public virtual void testPreflightProfile()
        {
            JDFDoc d = new JDFDoc("JDF");

            n = d.getJDFRoot();
            n.setType(EnumType.Preflight);

            inRun = (JDFRunList)n.appendMatchingResource(ElementName.RUNLIST, EnumProcessUsage.AnyInput, null);
            inRun.setFileURL("input.pdf");

            preparms = (JDFPreflightParams)n.appendMatchingResource(ElementName.PREFLIGHTPARAMS, EnumProcessUsage.AnyInput, null);
            prrp     = (JDFPreflightReportRulePool)n.appendMatchingResource(ElementName.PREFLIGHTREPORTRULEPOOL, EnumProcessUsage.AnyInput, null);

            // new
            aPool = (JDFActionPool)preparms.appendElement(ElementName.ACTIONPOOL);

            // now some simple tests...
            appendTransparency();
            appendNumPagesAction();
            appendSeparationAction();
            appendBWSeparationAction();
            appendTrimBoxAction();
            appendResolutionAction();
            appendResolutionActionBitMap();
            appendLineWeightAction();

            d.write2File(sm_dirTestDataTemp + "PreflightProfile.jdf", 2, false);
        }
Beispiel #3
0
        public virtual void testRemoveChild()
        {
            JDFDoc  d = new JDFDoc("JDF");
            JDFNode n = d.getJDFRoot();

            n.setType("ConventionalPrinting", true);
            JDFExposedMedia xmpl = (JDFExposedMedia)n.appendMatchingResource("ExposedMedia", EnumProcessUsage.Plate, null);
            JDFExposedMedia xmpr = (JDFExposedMedia)n.appendMatchingResource("ExposedMedia", EnumProcessUsage.Proof, null);
            JDFMedia        m    = xmpr.appendMedia();

            Assert.IsNotNull(xmpr.getMedia());
            m.setID("id1");
            KElement t1 = n.getTarget("id1", "ID");

            m = (JDFMedia)m.makeRootResource(null, null, true);
            Assert.AreEqual(m, t1);
            Assert.IsNotNull(xmpr.getMedia());
            xmpl.refElement(m);
            Assert.IsNotNull(xmpl.getMedia());
            JDFResourcePool rp = n.getResourcePool();

            Assert.IsNotNull(rp.getElement("Media"));
            xmpl.removeChild("Media", null, 0);
            Assert.IsNull(xmpl.getMedia());
            Assert.IsNotNull(rp.getElement("Media"));
            xmpr.removeChildren("Media", null, null);
            Assert.IsNull(xmpr.getMedia());
            Assert.IsNotNull(rp.getElement("Media"));
        }
Beispiel #4
0
 private void setUpDoc()
 {
     d = new JDFDoc("JDF");
     n = d.getJDFRoot();
     n.setJobID("JobID");
     n.setType(EnumType.Imposition);
     rlIn = (JDFRunList)n.appendMatchingResource("RunList", EnumProcessUsage.AnyInput, null);
     rlIn.setResStatus(EnumResStatus.Available, false);
     rlOut = (JDFRunList)n.appendMatchingResource("RunList", EnumProcessUsage.AnyOutput, null);
 }
Beispiel #5
0
 /// <summary>
 /// All the setUp calls except for base.setUp.
 /// Use when you want to redo a setup without doign a teardown.
 /// </summary>
 public void reSetUp()
 {
     JDFElement.setLongID(false);
     doc = new JDFDoc("JDF");
     n   = doc.getJDFRoot();
     n.setType(EnumType.Stripping);
     rl = (JDFRunList)n.appendMatchingResource(ElementName.RUNLIST, EnumProcessUsage.AnyInput, null);
     sp = (JDFStrippingParams)n.appendMatchingResource(ElementName.STRIPPINGPARAMS, EnumProcessUsage.AnyInput, null);
     bs = (JDFBinderySignature)n.addResource(ElementName.BINDERYSIGNATURE, null, null, null, null, null, null);
     sp.refBinderySignature(bs);
 }
Beispiel #6
0
        public virtual void testIsNewLayout()
        {
            Assert.AreEqual(EnumVersion.Version_1_3, n.getVersion(false), "version ok");
            JDFLayout lo = (JDFLayout)n.appendMatchingResource(ElementName.LAYOUT, EnumProcessUsage.AnyInput, null);

            Assert.IsTrue(JDFLayout.isNewLayout(lo), "lo 1.3");
            n.setVersion(EnumVersion.Version_1_2);
            Assert.IsFalse(JDFLayout.isNewLayout(lo), "lo 1.3");
            lo.addPartition(EnumPartIDKey.SheetName, "Sheet1");
            Assert.IsTrue(JDFLayout.isNewLayout(lo), "lo 1.3");
            Assert.IsFalse(JDFLayout.isNewLayout(rl), "l no layout");
        }
Beispiel #7
0
 public virtual void setUp()
 {
     doc = new JDFDoc("JDF");
     n   = doc.getJDFRoot();
     n.setType("Stripping", true);
     @as = (JDFAssembly)n.appendMatchingResource(ElementName.ASSEMBLY, EnumProcessUsage.AnyInput, null);
 }
Beispiel #8
0
        public virtual void testDevice()
        {
            JDFDoc  d = new JDFDoc(ElementName.JDF);
            JDFNode n = d.getJDFRoot();

            n.setType("Stitching", true);
            JDFDevice dev = (JDFDevice)n.appendMatchingResource(ElementName.DEVICE, EnumProcessUsage.AnyInput, null);

            dev.setResStatus(EnumResStatus.Available, true);
            dev.setKnownLocalizations(new VString("De", null));
            dev.setSerialNumber("12345");
            dev.setSecureJMFURL("http://fififi");
            JDFModule m = dev.appendModule();

            // m.setModuleIndex(0);
            m.setModelDescription("1234");
            JDFIconList il = dev.appendIconList();

            Assert.IsFalse(il.isValid(EnumValidationLevel.Complete), "empty iconlist");
            Assert.IsTrue(il.isValid(EnumValidationLevel.Incomplete), "empty iconlist");
            JDFIcon ic = il.appendIcon();

            ic.setSize(new JDFXYPair(200, 200));
            ic.setBitDepth(8);
            JDFFileSpec fs = ic.appendFileSpec();

            fs.setURL("file:///this.ico");

            Assert.IsTrue(ic.isValid(EnumValidationLevel.Complete), "icon valid");
            Assert.IsTrue(il.isValid(EnumValidationLevel.Complete), "iconlist valid");
            Assert.IsTrue(m.isValid(EnumValidationLevel.Complete), "mod valid");
            Assert.IsTrue(dev.isValid(EnumValidationLevel.Complete), "dev valid");
            Assert.IsTrue(dev.validClass());
        }
Beispiel #9
0
        public virtual void testPartAmountVirtual()
        {
            JDFDoc  d = new JDFDoc(ElementName.JDF);
            JDFNode n = d.getJDFRoot();

            n.setVersion(JDFElement.EnumVersion.Version_1_3);
            n.setType("ConventionalPrinting", true);
            JDFComponent comp = (JDFComponent)n.appendMatchingResource(ElementName.COMPONENT, EnumProcessUsage.AnyOutput, null);

            JDFResourceLink cpLink = n.getLink(comp, null);
            JDFAttributeMap mapBad = new JDFAttributeMap("Condition", "Waste");

            cpLink.setActualAmount(42, mapBad);
            Assert.AreEqual(42.0, cpLink.getActualAmount(mapBad), 0);
            Assert.IsTrue(n.isValid(EnumValidationLevel.Incomplete), "allow part amounts to non-existing partitions");

            cpLink.removeChild(ElementName.AMOUNTPOOL, null, 0);
            comp.addPartition(EnumPartIDKey.SheetName, "Sheet1");
            mapBad.put(EnumPartIDKey.SheetName.getName(), "Sheet1");
            cpLink.setActualAmount(42, mapBad);
            Assert.AreEqual(42.0, cpLink.getActualAmount(mapBad), 0);
            Assert.IsTrue(n.isValid(EnumValidationLevel.Incomplete), "allow partamounts to non-existing partitions");
            mapBad.put(EnumPartIDKey.SheetName.getName(), "Sheet2");
            Assert.AreEqual(0.0, cpLink.getActualAmount(mapBad), 0);
            JDFAttributeMap m2 = new JDFAttributeMap("Condition", "Waste");

            Assert.AreEqual(42.0, cpLink.getActualAmount(m2), 0);
            m2.put("SheetName", "Sheet1");
            Assert.AreEqual(42.0, cpLink.getActualAmount(m2), 0);
            m2.put("Side", "Front");
            Assert.AreEqual(0.0, cpLink.getActualAmount(m2), 0);
        }
Beispiel #10
0
 private void reset()
 {
     doc = new JDFDoc("JDF");
     n   = doc.getJDFRoot();
     n.setType(EnumType.Imposition);
     rl = (JDFRunList)n.appendMatchingResource(ElementName.RUNLIST, EnumProcessUsage.AnyInput, null);
 }
Beispiel #11
0
        /// <summary>
        /// All the setUp calls except for base.setUp.
        /// Use when you want to redo a setup without doign a teardown.
        /// </summary>
        public void reSetUp()
        {
            JDFElement.setLongID(false);
            JDFAudit.setStaticAgentName(null);
            JDFAudit.setStaticAgentVersion(null);
            JDFAudit.setStaticAuthor(null);

            doc = new JDFDoc("JDF");
            n   = doc.getJDFRoot();
            n.setJobID("JobID");
            n.setType(EnumType.Combined);
            n.setTypes(new VString("Interpreting Rendering DigitalPrinting Stitching", " "));
            comp       = (JDFComponent)n.addResource(ElementName.COMPONENT, null, EnumUsage.Output, null, null, null, null);
            rlComp     = n.getLink(comp, null);
            digiParams = (JDFDigitalPrintingParams)n.addResource(ElementName.DIGITALPRINTINGPARAMS, null, EnumUsage.Input, null, null, null, null);
            med        = (JDFMedia)n.appendMatchingResource(ElementName.MEDIA, EnumProcessUsage.AnyInput, null);
            med.setResStatus(EnumResStatus.Available, false);
            rlMedia = n.getLink(med, null);
            ruli    = (JDFRunList)n.appendMatchingResource(ElementName.RUNLIST, EnumProcessUsage.AnyInput, null);
        }
Beispiel #12
0
        public virtual void testGetHRefs()
        {
            JDFDoc  d = new JDFDoc("JDF");
            JDFNode n = d.getJDFRoot();

            n.setType("ConventionalPrinting", true);
            JDFExposedMedia xmpl = (JDFExposedMedia)n.appendMatchingResource("ExposedMedia", EnumProcessUsage.Plate, null);
            JDFExposedMedia xmpr = (JDFExposedMedia)n.appendMatchingResource("ExposedMedia", EnumProcessUsage.Proof, null);
            JDFMedia        m    = xmpr.appendMedia();

            Assert.IsNotNull(xmpr.getMedia());
            m.setID("id1");
            KElement t1 = n.getTarget("id1", "ID");

            m = (JDFMedia)m.makeRootResource(null, null, true);
            Assert.AreEqual(t1, m);
            Assert.IsTrue(n.getHRefs(null, true, false).Contains("id1"));
            Assert.IsTrue(xmpr.getHRefs(null, true, false).Contains("id1"));
            Assert.IsFalse(xmpl.getHRefs(null, true, false).Contains("id1"));
            Assert.IsTrue(n.getHRefs(null, true, true).Contains("id1"));
            Assert.IsTrue(xmpr.getHRefs(null, true, true).Contains("id1"));
            Assert.IsFalse(xmpl.getHRefs(null, true, true).Contains("id1"));
        }
Beispiel #13
0
        private void iterateSetup()
        {
            iterDoc  = new JDFDoc("JDF");
            iterNode = iterDoc.getJDFRoot();
            iterNode.setCombined(new VString("LayoutElementProduction Approval", " "));
            iterNode.setStatus(EnumNodeStatus.Waiting);
            iterLepp = (JDFLayoutElementProductionParams)iterNode.appendMatchingResource(ElementName.LAYOUTELEMENTPRODUCTIONPARAMS, EnumProcessUsage.AnyInput, null);
            iterLepp.setResStatus(EnumResStatus.Available, true);
            iterApp = (JDFApprovalParams)iterNode.appendMatchingResource(ElementName.APPROVALPARAMS, EnumProcessUsage.AnyInput, null);
            iterApp.setResStatus(EnumResStatus.Available, true);
            iterAppSuccess = (JDFApprovalSuccess)iterNode.appendMatchingResource(ElementName.APPROVALSUCCESS, EnumProcessUsage.AnyInput, null);
            iterAppSuccess.setResStatus(EnumResStatus.Unavailable, true);
            iterRuli = (JDFRunList)iterNode.appendMatchingResource(ElementName.RUNLIST, EnumProcessUsage.AnyOutput, null);
            iterRuli.setResStatus(EnumResStatus.Unavailable, true);
            inRuli = (JDFRunList)iterNode.addResource(ElementName.RUNLIST, null, EnumUsage.Input, null, null, null, null);
            inRuli.setResStatus(EnumResStatus.Available, true);

            iterRuli.addPDF(StringUtil.uncToUrl("C:\\local\\Myinput.pdf", true), 0, 3);
            iterRuli.setDescriptiveName("save in place - input equals output");
            inRuli.addPDF(StringUtil.uncToUrl("C:\\local\\Myinput.pdf", true), 0, 3);
            inRuli.addPDF(StringUtil.uncToUrl("C:\\local\\Image1.pdf", true), 0, 0);
            inRuli.addPDF(StringUtil.uncToUrl("C:\\local\\Image2.pdf", true), 0, 0);
            iterDoc.write2File(getIteration(0), 2, false);
        }
Beispiel #14
0
        public virtual void testMediaIntent()
        {
            JDFDoc  d = new JDFDoc(ElementName.JDF);
            JDFNode n = d.getJDFRoot();

            n.setType("Product", true);

            JDFMediaIntent mi = (JDFMediaIntent)n.appendMatchingResource(ElementName.MEDIAINTENT, EnumProcessUsage.AnyInput, null);
            JDFStringSpan  sb = mi.appendStockBrand();

            sb.setActual("abc foo");
            sb.setPreferred("abc foo");
            Assert.IsTrue(sb.isValid(EnumValidationLevel.Complete), "valid StockBrand");
            Assert.AreEqual(EnumResourceClass.Intent, mi.getValidClass());
            Assert.IsTrue(mi.validClass());
        }
Beispiel #15
0
        public virtual void testScore()
        {
            JDFDoc  d = new JDFDoc(ElementName.JDF);
            JDFNode n = d.getJDFRoot();

            n.setType("CoverApplication", true);
            JDFCoverApplicationParams cap = (JDFCoverApplicationParams)n.appendMatchingResource(ElementName.COVERAPPLICATIONPARAMS, EnumProcessUsage.AnyInput, null);
            JDFScore score = cap.appendScore();

            score.setSide(EnumScoreSide.FromInside);
            score.setOffset(1234.5);
            Assert.IsTrue(score.isValid(EnumValidationLevel.Complete), "score 1");
            score = cap.appendScore();
            score.setSide(EnumScoreSide.FromOutside);
            Assert.IsTrue(score.isValid(EnumValidationLevel.Complete), "score 2");
            Assert.IsTrue(cap.isValid(EnumValidationLevel.Complete), "cap");
            // we know that we are incomplete since we have missing resources
            Assert.IsTrue(n.isValid(EnumValidationLevel.Incomplete), "n");
        }
Beispiel #16
0
        public virtual void testPreflightReport()
        {
            testPreflightProfile();
            JDFPreflightReport prp = (JDFPreflightReport)n.appendMatchingResource(ElementName.PREFLIGHTREPORT, EnumProcessUsage.AnyOutput, null);

            prp.refElement(preparms);
            prp.refElement(inRun);
            prp.refElement(prrp);

            JDFAttributeMap prMap   = new JDFAttributeMap();
            VString         groupBy = new VString();

            prMap.put("CompressionTypes", "JPEG");
            prMap.put("PageNumber", "2");
            groupBy.Add("PageNumber");
            JDFPRItem pi = prp.setPR(aPool.getAction(0), 2, prMap, groupBy);

            Assert.IsNotNull(pi);
            Assert.AreEqual(1, pi.getOccurrences());
            prMap.put("CompressionTypes", "JPEG2000");
            JDFPRItem pi2 = prp.setPR(aPool.getAction(0), 2, prMap, groupBy);

            Assert.IsNotNull(pi2);
            Assert.AreEqual(2, pi2.getOccurrences());
            Assert.AreEqual(pi, pi2);
            prMap.put("PageNumber", "3");
            JDFPRItem pi3 = prp.setPR(aPool.getAction(0), 3, prMap, groupBy);

            Assert.IsNotNull(pi3);
            Assert.AreEqual(3, pi3.getOccurrences());
            Assert.AreEqual(pi3, pi);
            Assert.AreEqual(new JDFIntegerRangeList("2 ~ 3"), pi.getPageSet());
            JDFPRItem pi4 = prp.setPR(aPool.getAction(1), 3, null, null);

            Assert.AreEqual(1, pi4.getOccurrences());
            Assert.AreNotEqual(pi, pi4);
            Assert.AreEqual(new JDFIntegerRangeList("3"), pi4.getPageSet());

            Assert.AreEqual(2, prp.numChildElements(ElementName.PRITEM, null));
            n.getOwnerDocument_KElement().write2File(sm_dirTestDataTemp + "PreflightReport.jdf", 2, false);
        }
Beispiel #17
0
        public virtual void testApprovalSuccess()
        {
            n.setType("Approval", true);
            JDFApprovalSuccess @as = (JDFApprovalSuccess)n.appendMatchingResource(ElementName.APPROVALSUCCESS, EnumProcessUsage.AnyOutput, null);

            n.setVersion(EnumVersion.Version_1_2);
            @as.appendContact();
            @as.appendFileSpec();
            bool bRet = n.fixVersion(EnumVersion.Version_1_3);

            Assert.IsTrue(bRet, "fix ok");
            Assert.IsNotNull(@as.getApprovalDetails(0), "approvaldetails");
            bRet = n.fixVersion(EnumVersion.Version_1_2);
            Assert.IsTrue(bRet, "fix ok");
            Assert.IsNull(@as.getApprovalDetails(0), "approvaldetails");
            bRet = n.fixVersion(EnumVersion.Version_1_3);
            Assert.IsTrue(bRet, "fix ok");
            @as = (JDFApprovalSuccess)n.getMatchingResource(ElementName.APPROVALSUCCESS, EnumProcessUsage.AnyOutput, null, 0);
            JDFApprovalDetails ad = @as.getApprovalDetails(0);

            ad.setApprovalState(EnumApprovalState.Rejected);
            bRet = n.fixVersion(EnumVersion.Version_1_2);
            Assert.IsFalse(bRet, "fix not ok");
        }
Beispiel #18
0
        ///
        ///	 * <param name="n"> </param>
        ///	 * <param name="rlOut"> </param>
        ///
        private void setupLayout(bool complex)
        {
            JDFLayout    lo         = (JDFLayout)n.appendMatchingResource("Layout", EnumProcessUsage.AnyInput, null);
            JDFLayerList ll         = lo.appendLayerList();
            const string layerNames = "BackGround Language";

            VString layers = new VString(layerNames, " ");

            if (complex)
            {
                layers.Add("Currency");
            }

            for (int i = 0; i < layers.Count; i++)
            {
                ll.appendLayerDetails().setName(layers.stringAt(i));
            }

            JDFRunList rlOutDe = (JDFRunList)rlOut.addPartition(EnumPartIDKey.PartVersion, "De");

            rlOutDe.setResStatus(EnumResStatus.Available, true);
            JDFRunList rlOutEn = (JDFRunList)rlOut.addPartition(EnumPartIDKey.PartVersion, "Fr");

            rlOutEn.setResStatus(EnumResStatus.Unavailable, true);
            if (complex)
            {
                JDFRunList rlOutSwiss = (JDFRunList)rlOut.addPartition(EnumPartIDKey.PartVersion, "Ch");
                rlOutSwiss.setResStatus(EnumResStatus.Unavailable, true);
            }

            for (int i = 0; i < 2; i++)
            {
                string     sheetName = "Sheet" + i;
                JDFLayout  lSheet    = (JDFLayout)lo.addPartition(EnumPartIDKey.SheetName, sheetName);
                JDFRunList rlSheet   = (JDFRunList)rlOutDe.addPartition(EnumPartIDKey.SheetName, sheetName);
                for (int j = 0; j < 2; j++)
                {
                    string     side   = j == 0 ? "Front" : "Back";
                    JDFLayout  lSide  = (JDFLayout)lSheet.addPartition(EnumPartIDKey.Side, side);
                    JDFRunList rlSide = (JDFRunList)rlSheet.addPartition(EnumPartIDKey.Side, side);
                    rlSide.setFileURL("file://out/De/" + sheetName + "_" + side + ".tif");
                    for (int k = 0; k < 4; k++)
                    {
                        JDFContentObject poBkg = lSide.appendContentObject();
                        int ord = i * 8 + j * 4 + k;
                        poBkg.setOrd(ord);
                        poBkg.setOrdID(ord);

                        JDFMatrix matrix = new JDFMatrix(1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
                        matrix.shift((k % 2) * 200, (k / 2) * 300);
                        poBkg.setCTM(matrix);
                        poBkg.setLayerID(0);

                        JDFContentObject poLang = lSide.appendContentObject();
                        poLang.setOrd(ord + 16);
                        poLang.setOrdID(ord);
                        poLang.setCTM(matrix);
                        poLang.setLayerID(1);

                        if (complex)
                        {
                            JDFContentObject pOCurr = lSide.appendContentObject();
                            pOCurr.setOrd(ord + 32);
                            pOCurr.setOrdID(ord);
                            pOCurr.setCTM(matrix);
                            pOCurr.setLayerID(2);
                        }
                    }
                }
            }
        }
Beispiel #19
0
        public void testUsageCounter()
        {
            JDFElement.setLongID(false);
            JDFDoc  doc  = new JDFDoc("JDF");
            JDFNode root = doc.getJDFRoot();

            root.setType(EnumType.DigitalPrinting);
            JDFUsageCounter uc = (JDFUsageCounter)root.appendMatchingResource(
                ElementName.USAGECOUNTER, EnumProcessUsage.AnyInput, null);

            Assert.IsTrue(uc.isValid(EnumValidationLevel.Incomplete));
            Assert.IsFalse(uc.isValid(EnumValidationLevel.Complete));
            uc.setCounterID("c1");
            uc.setScope(EnumScope.Job);
            uc.setCounterTypes(new VString(
                                   "NormalSize Black OneSided TwoSided Impressions", " "));
            Assert.IsTrue(uc.isValid(EnumValidationLevel.Complete));
            Assert.AreEqual(StringUtil.setvString(uc.getEnumCounterTypes()),
                            StringUtil.setvString(uc.getCounterTypes()));
            JDFResourceLink rl = root.getLink(uc, null);

            rl.setActualAmount(10, null);
            JDFAuditPool     ap = root.getCreateAuditPool();
            JDFResourceAudit ra = (JDFResourceAudit)ap.addAudit(
                EnumAuditType.ResourceAudit, null);

            ra.updateLink(rl);

            JDFUsageCounter uc2 = (JDFUsageCounter)root.appendMatchingResource(
                ElementName.USAGECOUNTER, EnumProcessUsage.AnyInput, null);

            uc2.setCounterID("c2");
            uc2.setScope(EnumScope.Job);
            uc2.setCounterTypes(new VString(
                                    "NormalSize Color OneSided TwoSided Impressions", " "));
            Assert.IsTrue(uc2.isValid(EnumValidationLevel.Complete));
            Assert.AreEqual(StringUtil.setvString(uc2.getEnumCounterTypes()),
                            StringUtil.setvString(uc2.getCounterTypes()));
            rl = root.getLink(uc2, null);
            rl.setActualAmount(20, null);
            ra = (JDFResourceAudit)ap.addAudit(EnumAuditType.ResourceAudit, null);
            ra.updateLink(rl);

            JDFUsageCounter uc3 = (JDFUsageCounter)root.appendMatchingResource(
                ElementName.USAGECOUNTER, EnumProcessUsage.AnyInput, null);

            uc3.setCounterID("c3");
            uc3.setScope(EnumScope.Job);
            uc3.setCounterTypes(new VString(
                                    "LargeSize Black OneSided TwoSided Impressions", " "));
            Assert.IsTrue(uc3.isValid(EnumValidationLevel.Complete));
            Assert.AreEqual(StringUtil.setvString(uc3.getEnumCounterTypes()),
                            StringUtil.setvString(uc3.getCounterTypes()));
            rl = root.getLink(uc3, null);
            rl.setActualAmount(30, null);
            ra = (JDFResourceAudit)ap.addAudit(EnumAuditType.ResourceAudit, null);
            ra.updateLink(rl);

            JDFUsageCounter uc4 = (JDFUsageCounter)root.appendMatchingResource(
                ElementName.USAGECOUNTER, EnumProcessUsage.AnyInput, null);

            uc4.setCounterID("c4");
            uc4.setScope(EnumScope.Job);
            uc4.setCounterTypes(new VString(
                                    "LargeSize Color OneSided TwoSided Impressions", " "));
            Assert.IsTrue(uc4.isValid(EnumValidationLevel.Complete));
            Assert.AreEqual(StringUtil.setvString(uc4.getEnumCounterTypes()),
                            StringUtil.setvString(uc4.getCounterTypes()));
            rl = root.getLink(uc4, null);
            rl.setActualAmount(40, null);
            ra = (JDFResourceAudit)ap.addAudit(EnumAuditType.ResourceAudit, null);
            ra.updateLink(rl);
            Assert.IsTrue(root.isValid(EnumValidationLevel.Incomplete));

            doc.write2File(sm_dirTestDataTemp + "UCList.jdf", 2, false);
        }
Beispiel #20
0
        public virtual void testAmount()
        {
            rlComp.setAmount(20, null);
            rlComp.setDescriptiveName("The link points to 20 planned and 20 good + 2 Waste brochures");

            JDFMiscConsumable mc = (JDFMiscConsumable)n.appendMatchingResource(ElementName.MISCCONSUMABLE, EnumProcessUsage.AnyInput, null);

            mc.setResStatus(EnumResStatus.Available, false);
            mc.setConsumableType("FooBar");
            mc.setUnit("Fnarfs");
            mc.setDescriptiveName("FooBars are always measured in Fnarfs");
            JDFResourceLink rlmc = n.getLink(mc, null);

            rlmc.setAmount(42, null);
            rlmc.setDescriptiveName("The link points to 42 actual FooBars");

            JDFUsageCounter uc = (JDFUsageCounter)n.appendMatchingResource(ElementName.USAGECOUNTER, EnumProcessUsage.AnyInput, null);

            uc.setResStatus(EnumResStatus.Available, false);
            uc.setCounterTypes(new VString("Click", " "));
            JDFResourceLink rlu = n.getLink(uc, null);

            rlu.setAmount(200, null);
            rlu.setDescriptiveName("The link points to 200 actual clicks");

            rlMedia.setAmount(100, null);
            rlMedia.setDescriptiveName("The link points to 100 actual sheets");

            Thread.Sleep(1000);
            comp.setResStatus(EnumResStatus.Available, true);

            VElement vRL = new VElement();

            vRL.Add(rlComp);
            vRL.Add(rlu);
            vRL.Add(rlMedia);
            vRL.Add(rlmc);
            StatusUtil stUtil = new StatusUtil(n, null, vRL);

            stUtil.setDeviceID("MyDevice");
            stUtil.setTrackWaste(rlMedia, true);
            stUtil.setTrackWaste(rlComp, true);
            stUtil.setCopyResInResInfo(rlu, true);

            doc.write2File(sm_dirTestDataTemp + "DigiPrintAmount_initial.jdf", 2, false);

            AmountBag[] bags = new AmountBag[vRL.Count];
            bags[0] = new AmountBag(rlComp.getrRef());
            bags[1] = new AmountBag(rlu.getrRef());
            bags[2] = new AmountBag(rlMedia.getrRef());
            bags[3] = new AmountBag(rlmc.getrRef());
            stUtil.setPhase(EnumNodeStatus.InProgress, "Waste", EnumDeviceStatus.Running, null, bags);
            JDFDoc docStatusJMF = stUtil.getDocJMFPhaseTime();

            docStatusJMF.write2File(sm_dirTestDataTemp + "DigiPrintAmountStatus0.jmf", 2, false);
            JDFDoc docResJMF = stUtil.getDocJMFResource();

            docResJMF.write2File(sm_dirTestDataTemp + "DigiPrintAmountResource0.jmf", 2, false);

            bags[0].addPhase(0, 2, true);
            bags[1].addPhase(0, 20, true);
            bags[2].addPhase(0, 10, true);
            bags[3].addPhase(0, 0, true);
            stUtil.setPhase(EnumNodeStatus.InProgress, "Waste", EnumDeviceStatus.Running, null, bags);
            docStatusJMF = stUtil.getDocJMFPhaseTime();
            docStatusJMF.write2File(sm_dirTestDataTemp + "DigiPrintAmountStatus1.jmf", 2, false);
            docResJMF = stUtil.getDocJMFResource();
            docResJMF.write2File(sm_dirTestDataTemp + "DigiPrintAmountResource1.jmf", 2, false);

            bags[0].addPhase(15, 0, true);
            bags[1].addPhase(150, 0, true);
            bags[2].addPhase(75, 0, true);
            bags[3].addPhase(32, 0, true);
            stUtil.setPhase(EnumNodeStatus.InProgress, "Good", EnumDeviceStatus.Running, null, bags);
            docStatusJMF = stUtil.getDocJMFPhaseTime();
            docStatusJMF.write2File(sm_dirTestDataTemp + "DigiPrintAmountStatus2.jmf", 2, false);
            docResJMF = stUtil.getDocJMFResource();
            docResJMF.write2File(sm_dirTestDataTemp + "DigiPrintAmountResource2.jmf", 2, false);

            bags[0].addPhase(5, 0, false);
            bags[1].addPhase(50, 0, false);
            bags[2].addPhase(25, 0, false);
            bags[3].addPhase(11, 0, false);
            stUtil.setPhase(EnumNodeStatus.InProgress, "Good", EnumDeviceStatus.Running, null, bags);
            docStatusJMF = stUtil.getDocJMFPhaseTime();
            docStatusJMF.write2File(sm_dirTestDataTemp + "DigiPrintAmountStatus3.jmf", 2, false);
            docResJMF = stUtil.getDocJMFResource();
            docResJMF.write2File(sm_dirTestDataTemp + "DigiPrintAmountResource3.jmf", 2, false);

            bags[0].addPhase(0, 0, true);
            bags[1].addPhase(0, 0, true);
            bags[2].addPhase(0, 0, true);
            bags[3].addPhase(0, 0, true);
            stUtil.setPhase(EnumNodeStatus.Completed, "Idle", EnumDeviceStatus.Idle, null, bags);
            docStatusJMF = stUtil.getDocJMFPhaseTime();
            docStatusJMF.write2File(sm_dirTestDataTemp + "DigiPrintAmountStatus4.jmf", 2, false);
            docResJMF = stUtil.getDocJMFResource();
            docResJMF.write2File(sm_dirTestDataTemp + "DigiPrintAmountResource4.jmf", 2, false);

            doc.write2File(sm_dirTestDataTemp + "DigiPrintAmount_final.jdf", 2, false);
        }
Beispiel #21
0
        protected internal static JDFDoc creatXMDoc()
        {
            JDFElement.setDefaultJDFVersion(EnumVersion.Version_1_3);
            JDFDoc  doc = new JDFDoc("JDF");
            JDFNode n   = doc.getJDFRoot();

            n.setJobPartID("P1");
            n.setJobID("J1");
            n.setType("ConventionalPrinting", true);
            n.appendElement("NS:Foobar", "www.foobar.com");

            n.appendMatchingResource("Layout", JDFNode.EnumProcessUsage.AnyInput, null);
            JDFComponent    comp = (JDFComponent)n.appendMatchingResource("Component", JDFNode.EnumProcessUsage.AnyOutput, null);
            JDFExposedMedia xm   = (JDFExposedMedia)n.appendMatchingResource("ExposedMedia", JDFNode.EnumProcessUsage.Plate, null);
            JDFNodeInfo     ni   = n.appendNodeInfo();
            JDFMedia        m    = xm.appendMedia();

            m.appendElement("NS:FoobarMedia", "www.foobar.com");

            Assert.AreEqual(EnumResourceClass.Consumable, m.getResourceClass(), "m Class");

            VString vs = new VString();

            vs.Add("SignatureName");
            vs.Add("SheetName");
            vs.Add("Side");

            JDFAttributeMap mPart1 = new JDFAttributeMap("SignatureName", "Sig1");

            mPart1.put("SheetName", "S1");
            mPart1.put("Side", "Front");
            xm.getCreatePartition(mPart1, vs);
            ni.getCreatePartition(mPart1, vs);
            comp.getCreatePartition(mPart1, vs);

            mPart1.put("Side", "Back");
            xm.getCreatePartition(mPart1, vs);
            ni.getCreatePartition(mPart1, vs);
            comp.getCreatePartition(mPart1, vs);

            mPart1.put("SheetName", "S2");
            mPart1.put("Side", "Front");
            xm.getCreatePartition(mPart1, vs);
            ni.getCreatePartition(mPart1, vs);
            comp.getCreatePartition(mPart1, vs);

            mPart1.put("Side", "Back");
            xm.getCreatePartition(mPart1, vs);
            ni.getCreatePartition(mPart1, vs);
            comp.getCreatePartition(mPart1, vs);

            mPart1.put("SignatureName", "Sig2");
            mPart1.put("SheetName", "S1");
            mPart1.put("Side", "Front");
            xm.getCreatePartition(mPart1, vs);
            ni.getCreatePartition(mPart1, vs);
            comp.getCreatePartition(mPart1, vs);
            comp.appendElement("foo:bar", "www.foobar.com");

            mPart1.put("Side", "Back");
            xm.getCreatePartition(mPart1, vs);
            ni.getCreatePartition(mPart1, vs);
            comp.getCreatePartition(mPart1, vs);

            mPart1.put("SheetName", "S2");
            mPart1.put("Side", "Front");
            xm.getCreatePartition(mPart1, vs);
            ni.getCreatePartition(mPart1, vs);
            comp.getCreatePartition(mPart1, vs);

            mPart1.put("Side", "Back");
            xm.getCreatePartition(mPart1, vs);
            ni.getCreatePartition(mPart1, vs);
            comp.getCreatePartition(mPart1, vs);
            return(doc);
        }
Beispiel #22
0
        public virtual void testAutomateLayout_PlateSet()
        {
            for (int loop = 0; loop < 3; loop++)
            {
                n.getAuditPool().appendXMLComment("This is a simple example of an automated layout used for conventional prepress\n" + "The structure is aligned as closely as possible with a static Layout", null);

                JDFRunList run = rl.addRun("file://host/data/test.pdf", 0, -1);
                run.setNPage(128);
                rl.setResStatus(EnumResStatus.Available, true);
                rl.setDescriptiveName("This is a RunList specifiying 128 pages each in a pdf file.");

                lo = (JDFLayout)n.appendMatchingResource(ElementName.LAYOUT, EnumProcessUsage.AnyInput, null);
                lo.setResStatus(EnumResStatus.Available, true);

                lo.setMaxOrd(4);
                lo.setAutomated(true);
                const string format = "Sheet%02i";
                lo.setAttribute("NameFormat", format);
                lo.setAttribute("NameTemplate", "SheetNum");
                lo.appendXMLComment("Simple automated Layout with exactly one sheet\n", null);
                JDFLayout sheet = (JDFLayout)lo.addPartition(EnumPartIDKey.SheetName, "Sheet");
                sheet.setDescriptiveName("two sided 2 up sheet");
                JDFLayout        sheetFront = (JDFLayout)sheet.addPartition(EnumPartIDKey.Side, EnumSide.Front);
                JDFContentObject co         = sheetFront.appendContentObject();
                co.setCTM(new JDFMatrix(1, 0, 0, 1, 0, 0));
                co.setOrd(0);
                co.setDescriptiveName("Front 1st, 5th, 9th... Page");

                co = sheetFront.appendContentObject();
                co.setCTM(new JDFMatrix(1, 0, 0, 1, 8.5 * 72, 0));
                co.setOrd(1);
                co.setDescriptiveName("Front 2nd, 6th, 10th... page");

                JDFLayout sheetBack = (JDFLayout)sheet.addPartition(EnumPartIDKey.Side, EnumSide.Back);
                co = sheetBack.appendContentObject();
                co.setCTM(new JDFMatrix(1, 0, 0, 1, 0, 0));
                co.setOrd(2);
                co.setDescriptiveName("Back 3rd, 7th, 11th... Page");

                co = sheetBack.appendContentObject();
                co.setCTM(new JDFMatrix(1, 0, 0, 1, 8.5 * 72, 0));
                co.setOrd(3);
                co.setDescriptiveName("Back 4th, 8th, 12th... page");

                JDFRunList rlSheet = (JDFRunList)n.appendMatchingResource(ElementName.RUNLIST, EnumProcessUsage.AnyOutput, null);
                rlSheet.setDirectory("file://host/out/");
                if (loop == 0) // instantiate individually
                {
                    PrintfFormat fmt = new PrintfFormat(format);
                    for (int i = 0; i < 128; i += 4)
                    {
                        string     sheetName = fmt.tostr(1 + i / 4);
                        JDFRunList rlp       = (JDFRunList)rlSheet.addPartition(EnumPartIDKey.SheetName, sheetName);
                        JDFRunList rlF       = (JDFRunList)rlp.addPartition(EnumPartIDKey.Side, EnumSide.Front);
                        rlF.appendLayoutElement().setMimeURL(sheetName + "Front.pdf");
                        JDFRunList rlB = (JDFRunList)rlp.addPartition(EnumPartIDKey.Side, EnumSide.Back);
                        rlB.appendLayoutElement().setMimeURL(sheetName + "Back.pdf");
                    }
                }
                if (loop == 1) // instantiate individually
                {
                    rlSheet.appendLayoutElement().setMimeURL("AllSheets.pdf");
                    PrintfFormat        fmt = new PrintfFormat(format);
                    JDFIntegerRangeList integerRangeList = new JDFIntegerRangeList();
                    for (int i = 0; i < 128; i += 4)
                    {
                        string     sheetName = fmt.tostr(1 + i / 4);
                        JDFRunList rlp       = (JDFRunList)rlSheet.addPartition(EnumPartIDKey.SheetName, sheetName);
                        JDFRunList rlF       = (JDFRunList)rlp.addPartition(EnumPartIDKey.Side, EnumSide.Front);
                        integerRangeList.Clear();
                        integerRangeList.Append(i / 2);
                        rlF.setPages(integerRangeList);
                        JDFRunList rlB = (JDFRunList)rlp.addPartition(EnumPartIDKey.Side, EnumSide.Back);
                        integerRangeList.Clear();
                        integerRangeList.Append(1 + i / 2);
                        rlB.setPages(integerRangeList);
                    }
                }
                else
                // instantiate by template
                {
                    JDFFileSpec fs = rlSheet.appendLayoutElement().appendFileSpec();
                    fs.setMimeType("application/pdf");
                    fs.setFileFormat(format + "%s_%s.pdf");
                    fs.setFileTemplate("SheetNum,Surface,Separation");
                }

                doc.write2File(sm_dirTestDataTemp + "AutomatedLayout_Plateset" + loop + ".jdf", 2, false);
                n.getResourceLinkPool().deleteNode();
                n.getResourcePool().deleteNode();
            }
        }
Beispiel #23
0
        public virtual void testCombinedVarnish()
        {
            JDFElement.setLongID(false);
            JDFDoc  d            = new JDFDoc("JDF");
            JDFNode n            = d.getJDFRoot();
            VString vCombiNodes  = new VString("ConventionalPrinting Varnishing", " ");
            VString vSeparations = new VString("Cyan Magenta Yellow Black Varnish", " ");

            n.setCombined(vCombiNodes);

            JDFConventionalPrintingParams cpp = (JDFConventionalPrintingParams)n.addResource(ElementName.CONVENTIONALPRINTINGPARAMS, null, EnumUsage.Input, null, null, null, null);

            cpp.setModuleAvailableIndex(new JDFIntegerRangeList("1 ~ 6"));
            cpp.setModuleIndex(new JDFIntegerRangeList("1 ~ 4 6"));
            cpp.appendXMLComment("Module 0 and 7 are varnishing modules, 1-4 are process colors and 6 is the ink module used to varnish", null);
            n.appendMatchingResource("Component", JDFNode.EnumProcessUsage.AnyOutput, null);
            JDFExposedMedia xm = (JDFExposedMedia)n.appendMatchingResource("ExposedMedia", JDFNode.EnumProcessUsage.Plate, null);

            n.appendNodeInfo();
            JDFMedia media = xm.appendMedia();

            media.setMediaType(EnumMediaType.Plate);
            JDFInk ink = (JDFInk)n.appendMatchingResource("Ink", JDFNode.EnumProcessUsage.AnyInput, null);

            JDFResource     vp           = n.addResource("VarnishingParams", EnumResourceClass.Parameter, EnumUsage.Input, null, null, null, null);
            JDFExposedMedia xmVarnish    = (JDFExposedMedia)n.addResource("ExposedMedia", null, EnumUsage.Input, null, null, null, null);
            JDFMedia        mediaVarnish = xmVarnish.appendMedia();

            mediaVarnish.setAttribute("MediaType", "Sleeve");

            JDFResourceLink    rl = n.getLink(xmVarnish, null);
            JDFColorantControl cc = (JDFColorantControl)n.appendMatchingResource(ElementName.COLORANTCONTROL, JDFNode.EnumProcessUsage.AnyInput, null);

            cc.getCreateDeviceColorantOrder().appendXMLComment("Should the VarnishingParams seps be excluded, as is shown here?", null);
            cc.getCreateDeviceColorantOrder().setSeparations(vSeparations);

            rl.setCombinedProcessIndex(new JDFIntegerList("1"));
            vSeparations.addAll(new VString("PreVarnish Varnish2", " "));

            for (int i = 0; i < vSeparations.Count; i++)
            {
                string sep = vSeparations.stringAt(i);
                ink.addPartition(EnumPartIDKey.Separation, sep);
                if (!sep.Equals("PreVarnish") && !sep.Equals("Varnish2"))
                {
                    xm.addPartition(EnumPartIDKey.Separation, sep);
                }
                if (sep.Equals("Varnish2"))
                {
                    vp.appendXMLComment("full varnishing in a varnishing module with or wihtout a sleeve. Full varnishing means to cover the complete media surface.", null);
                    xmVarnish.addPartition(EnumPartIDKey.Separation, sep);
                    JDFResource varnishPart = vp.addPartition(EnumPartIDKey.Separation, sep);
                    varnishPart.setAttribute("ModuleIndex", "7");
                    varnishPart.setAttribute("VarnishMethod", "Sleeve");
                    varnishPart.setAttribute("VarnishArea", "Spot");
                }
                else if (sep.Equals("Varnish"))
                {
                    vp.appendXMLComment("varnishing in a printing module only  with a mandatory plate. The plate may be exposed or not, for example,  for full varnihing. ", null);
                    // xmVarnish.addPartition(EnumPartIDKey.Separation, sep);
                    JDFResource varnishPart = vp.addPartition(EnumPartIDKey.Separation, sep);
                    varnishPart.setAttribute("ModuleIndex", "6");
                    varnishPart.setAttribute("VarnishMethod", "Plate");
                    varnishPart.setAttribute("VarnishArea", "Full");
                }
                else if (sep.Equals("PreVarnish"))
                {
                    vp.appendXMLComment("varnishing in a varnishing module only with a mandatory prepared sleeve ", null);
                    xmVarnish.addPartition(EnumPartIDKey.Separation, sep);
                    JDFResource varnishPart = vp.addPartition(EnumPartIDKey.Separation, sep);
                    varnishPart.setAttribute("ModuleIndex", "0");
                    varnishPart.setAttribute("VarnishMethod", "Sleeve");
                    varnishPart.setAttribute("VarnishArea", "Full");
                }
            }

            d.write2File(sm_dirTestDataTemp + "varnishing.jdf", 2, true);
        }