Пример #1
0
        public virtual void testAutoRegister()
        {
            Assert.AreEqual(EnumVersion.Version_1_3, n.getVersion(false), "version ok");
            JDFLayout            lo      = (JDFLayout)n.appendMatchingResource(ElementName.LAYOUT, EnumProcessUsage.AnyInput, null);
            JDFColorControlStrip autoReg = lo.appendMarkObject().appendColorControlStrip();

            autoReg.setStripType("AutoRegister");
            autoReg.appendElement("SeparationSpec").setAttribute("Name", "Black");
            autoReg.appendElement("SeparationSpec").setAttribute("Name", "Cyan");
            autoReg.appendElement("SeparationSpec").setAttribute("Name", "Yellow");
            autoReg.appendElement("SeparationSpec").setAttribute("Name", "Magenta");
            autoReg.appendElement("SeparationSpec").setAttribute("Name", "Spot1");
            autoReg.appendElement("SeparationSpec").setAttribute("Name", "Spot2");
            JDFColorControlStrip fms = lo.getMarkObject(0).appendColorControlStrip();

            fms.setStripType("FMS");
            fms.appendElement("SeparationSpec").setAttribute("Name", "Black");
            fms.appendElement("SeparationSpec").setAttribute("Name", "Yellow");
            fms.appendElement("SeparationSpec").setAttribute("Name", "Magenta");
            fms.appendElement("SeparationSpec").setAttribute("Name", "Cyan");

            fms = lo.getMarkObject(0).appendColorControlStrip();
            fms.setStripType("FMS");
            fms.appendElement("SeparationSpec").setAttribute("Name", "Spot1");
            fms.appendElement("SeparationSpec").setAttribute("Name", "Spot2");
            doc.write2File(sm_dirTestDataTemp + "autoregister.jdf", 2, false);
        }
Пример #2
0
        public virtual void testObjectTagsMetadata()
        {
            KElement tagMap = rl.appendElement(METADATA_MAP);

            tagMap.setXMLComment("This tagmap specifies The path for the NMTOKEN \"ObjectTag\"");
            tagMap.setAttribute("Name", "ObjectTags");
            tagMap.setAttribute(AttributeName.VALUEFORMAT, "%s");
            tagMap.setAttribute(AttributeName.CONTEXT, "Object");
            tagMap.setAttribute(AttributeName.DATATYPE, "NMTOKEN");
            tagMap.setAttribute(AttributeName.VALUETEMPLATE, "AnyName1");
            tagMap.addNameSpace("TIFFXMP", "http://ns.adobe.com/tiff/1.0");
            string[] ss = new string[] { "Acme", "Bcme", "Ccme" };
            for (int i = 0; i < ss.Length; i++)
            {
                string   s      = ss[i];
                KElement tagSet = tagMap.appendElement(EXPR);
                tagSet.setAttribute("Name", "AnyName1");
                tagSet.setAttribute("Value", s);

                JDFStringEvaluation eval = (JDFStringEvaluation)tagSet.appendElement(ElementName.STRINGEVALUATION);
                eval.setAttribute("Path", "TIFFXMP:Make");
                eval.setRegExp("(.*)" + s + "(.*)");
                eval.setXMLComment("Any acme camera is mapped to \"" + s + "\"");
            }
            JDFColorSpaceConversionParams csp = (JDFColorSpaceConversionParams)root.addResource(ElementName.COLORSPACECONVERSIONPARAMS, EnumUsage.Input);

            csp.setXMLComment("This ColorSpaceConversionParams treats Acme and Bcme cameras the same but differentiates for Ccme");
            JDFColorSpaceConversionOp op1 = csp.appendColorSpaceConversionOp();

            op1.setAttribute("ObjectTags", "Acme Bcme");
            JDFColorSpaceConversionOp op2 = csp.appendColorSpaceConversionOp();

            op2.setAttribute("ObjectTags", "Ccme");
            doc.write2File(sm_dirTestDataTemp + "objectTags.jdf", 2, false);
        }
Пример #3
0
        public virtual void testPlannedWasteICS()
        {
            JDFAmountPool ap   = rlOut.getCreateAmountPool();
            JDFAmountPool apIn = rlMediaIn.getCreateAmountPool();

            JDFComponent    cover = (JDFComponent)outComp.addPartition(EnumPartIDKey.SheetName, "Cover");
            JDFAttributeMap map   = cover.getPartMap();

            ap.appendXMLComment("Want 10000-10400 good cover sheets and allow for 500 waste cover sheets", null);
            map.put(EnumPartIDKey.Condition, "Good");
            rlOut.setAmount(10000, map);
            rlOut.setMaxAmount(10400, map);
            apIn.appendXMLComment("Amount[Good]: planned consumption for good production\n" + "MaxAmount[Good]: planned maximum consumption for good production\n" + "MaxAmount[Waste]: planned Media for waste", null);
            rlMediaIn.setAmount(10500, map);
            map.put(EnumPartIDKey.Condition, "Waste");
            rlMediaIn.setMaxAmount(500, map);

            ap.appendXMLComment("Want 20000 good first insert sheets and allow for 200 waste insert sheets", null);
            JDFComponent sheet1 = (JDFComponent)outComp.addPartition(EnumPartIDKey.SheetName, "Sheet1");

            map = sheet1.getPartMap();
            map.put(EnumPartIDKey.Condition, "Good");
            rlOut.setAmount(20000, map);
            rlOut.setMaxAmount(20800, map);
            rlMediaIn.setAmount(21000, map);
            map.put(EnumPartIDKey.Condition, "Waste");
            rlMediaIn.setMaxAmount(200, map);

            ap.appendXMLComment("Want 20000 good second insert sheets and allow for 100 waste insert sheets", null);
            JDFComponent sheet2 = (JDFComponent)outComp.addPartition(EnumPartIDKey.SheetName, "Sheet2");

            map = sheet2.getPartMap();
            map.put(EnumPartIDKey.Condition, "Good");
            rlOut.setAmount(20000, map);
            rlOut.setMaxAmount(20800, map);
            rlMediaIn.setAmount(20900, map);
            map.put(EnumPartIDKey.Condition, "Waste");
            rlMediaIn.setMaxAmount(100, map);

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

            //
            //		 * map=cover.getPartMap(); map.put(EnumPartIDKey.Condition, "Good");
            //		 * rl.getAmountPool().getPartAmount(map,0).appendXMLComment(
            //		 * "Actually produced covers: 10200\nWaste put on output stack:100");
            //		 * rlIn.getAmountPool().getPartAmount(map,0).appendXMLComment(
            //		 * "Total consumed sheets: 10400\nOf that: sheets wasted: 200");
            //		 * rl.setActualAmount(10200, map); rlIn.setActualAmount(10200, map);
            //		 * map.put(EnumPartIDKey.Condition, "Waste"); rl.setActualAmount(100,
            //		 * map); rlIn.setActualAmount(200, map);
            //		 *
            //		 * d.write2File(sm_dirTestDataTemp+"actualWasteICS.jdf", 2, true);
            //
        }
Пример #4
0
        private void iterateFirst()
        {
            iterateRead(0);
            JDFPhaseTime pt = iterNode.getAuditPool().setPhase(EnumNodeStatus.InProgress, "First Iteration Ongoing", null, null);

            pt.setStart(new JDFDate(JDFDate.ToMillisecs(DateTime.Now) - 100000));
            pt.setEnd(new JDFDate(JDFDate.ToMillisecs(DateTime.Now)));
            pt.appendEmployee().setPersonalID("Employee 1");
            pt.appendDevice().setDeviceID("Device 1");
            iterRuli.setResStatus(EnumResStatus.Draft, false);
            iterNode.setStatus(EnumNodeStatus.Suspended);
            iterNode.setAttribute("StatusDetails", ITERATION_PAUSED);
            iterDoc.write2File(getIteration(1), 2, false);
        }
Пример #5
0
        public virtual void testReprintJMF()
        {
            testAuditsImageSetting();
            statCounter.setActiveNode(null, null, null);
            string           sheet        = vsSheet.stringAt(1);
            VJDFAttributeMap vmP          = new VJDFAttributeMap();
            JDFAttributeMap  attributeMap = new JDFAttributeMap(EnumPartIDKey.SheetName, sheet);

            attributeMap.put("SignatureName", "Sig1");
            attributeMap.put("Separation", vsCMYK.stringAt(3));
            attributeMap.put("Side", "Front");

            vmP.Add(attributeMap);
            statCounter.setActiveNode(n, vmP, vRL);
            string refXM    = rlXMOut.getrRef();
            string refMedia = rlMediaIn.getrRef();

            statCounter.setTrackWaste(refXM, true);
            statCounter.setTrackWaste(refMedia, false);

            statCounter.setActiveNode(n, vmP, vRL);
            statCounter.setWorkType(EnumWorkType.Rework);
            statCounter.setPhase(EnumNodeStatus.InProgress, "Imaging", EnumDeviceStatus.Running, null);
            statCounter.addPhase(refMedia, 1, 0, true);
            statCounter.addPhase(refXM, 1, 0, true);
            statCounter.setPhase(EnumNodeStatus.InProgress, "Imaging", EnumDeviceStatus.Running, null);
            JDFDoc d2  = statCounter.getDocJMFResource();
            JDFJMF jmf = d2.getJMFRoot();

            jmf.convertResponses(null);
            VElement vSigs = jmf.getMessageVector(JDFMessage.EnumFamily.Signal, JDFMessage.EnumType.Resource);

            d2.write2File(sm_dirTestDataTemp + "ImageSetResourceReprint_.jmf", 2, false);
            JDFDoc dStatusJMF = statCounter.getDocJMFPhaseTime();

            jmf = dStatusJMF.getJMFRoot();
            jmf.convertResponses(null);
            for (int i = 0; i < vSigs.Count; i++)
            {
                jmf.copyElement(vSigs.item(i), null);
            }
            dStatusJMF.write2File(sm_dirTestDataTemp + "ImageSetReprint_.jmf", 2, false);

            // JDFResourceAudit ra=
            statCounter.setResourceAudit(refMedia, EnumReason.ProcessResult);
            // JDFProcessRun pr=
            statCounter.setProcessResult(EnumNodeStatus.Completed);

            d.write2File(sm_dirTestDataTemp + "ImageSetAmount_Reprint.jdf", 2, false);
        }
Пример #6
0
        public virtual void testAutomatedStripping()
        {
            n.setType(EnumType.Stripping);
            stripParams = (JDFStrippingParams)n.addResource(ElementName.STRIPPINGPARAMS, null, EnumUsage.Input, null, null, null, null);
            stripParams.getParentNode_KElement().appendXMLComment("Simple automated StrippingParams with exactly one sheet class\n", stripParams);
            JDFStrippingParams stripSheet = (JDFStrippingParams)stripParams.addPartition(EnumPartIDKey.SheetName, "Sheets");

            stripSheet.setAttribute(AttributeName.AUTOMATED, true, null);
            const string format = "Sheet%02i";

            stripSheet.setAttribute("NameFormat", format);
            stripSheet.setAttribute("NameTemplate", "SheetNum");
            stripSheet.appendBinderySignature().setNumberUp(new JDFXYPair(2, 2));
            doc.write2File(sm_dirTestDataTemp + "AutomatedStripping.jdf", 2, false);
        }
Пример #7
0
        ///
        ///	 <summary> * simulate running 2 separations on one press
        ///	 *  </summary>
        ///	 * <param name="bLast">
        ///	 *            TODO </param>
        ///
        //JAVA TO VB & C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
        //ORIGINAL LINE: private void run2Seps(String sheet, EnumSide side, String sep1, String sep2, @SuppressWarnings("unused") int good, @SuppressWarnings("unused") int waste, @SuppressWarnings("unused") String deviceID, @SuppressWarnings("unused") EnumNodeStatus endStatus, boolean bLast)
        private void run2Seps(string sheet, EnumSide side, string sep1, string sep2, int good, int waste, string deviceID, EnumNodeStatus endStatus, bool bLast)
        {
            string jmfFile = sm_dirTestDataTemp + "NColorStatus";

            JDFAttributeMap[] map = new JDFAttributeMap[sep1 == null ? 1 : 2];
            map[0] = new JDFAttributeMap(EnumPartIDKey.SheetName, sheet);
            map[0].put(EnumPartIDKey.Side, side);
            map[0].put(EnumPartIDKey.SignatureName, "Sig1");
            jmfFile += sheet + "_" + side.getName();
            bool bFirst = !doneSheets.Contains(sheet);

            if (bFirst)
            {
                doneSheets.Add(sheet);
            }

            if (sep1 != null)
            {
                map[1] = new JDFAttributeMap(map[0]);
                map[0].put(EnumPartIDKey.Separation, sep1);
                map[1].put(EnumPartIDKey.Separation, sep2);
                jmfFile += "_" + sep1 + "_" + sep2;
            }
            VJDFAttributeMap vMap = new VJDFAttributeMap(map);

            bgt.makeReady();
            bgt.execute(vMap, bLast, bFirst);
            JDFDoc jmfStatus = bgt.getStatusCounter().getDocJMFPhaseTime();

            jmfStatus.write2File(jmfFile + "_status.jmf", 2, false);
            JDFDoc jmfRes = bgt.getStatusCounter().getDocJMFResource();

            jmfRes.write2File(jmfFile + "_resource.jmf", 2, false);
        }
Пример #8
0
        public virtual void testComponentManifest()
        {
            root.getLink(c, null).setUsage(EnumUsage.Output);
            // TODO complete

            doc.write2File(sm_dirTestDataTemp + "ComponentManifest.jdf", 2, false);
        }
Пример #9
0
        public virtual void testEvent()
        {
            Assert.IsNull(sc.getDocJMFNotification(false));
            sc.setEvent("id", "value", "blah blah");
            d = sc.getDocJMFNotification(false);
            JDFDoc d2 = sc.getDocJMFNotification(false);

            Assert.IsTrue(d.getRoot().isEqual(d2.getRoot()));
            d  = sc.getDocJMFNotification(true);
            d2 = sc.getDocJMFNotification(false);
            Assert.IsNull(d2);
            JDFJMF          jmf  = d.getJMFRoot();
            JDFNotification noti = jmf.getSignal(0).getNotification();

            Assert.AreEqual(noti.getJobID(), n.getJobID(true));
            Assert.IsNotNull(noti.getEvent());
            d.write2File(sm_dirTestDataTemp + "jmfNotification.jmf", 2, false);
            Assert.IsTrue(jmf.isValid(EnumValidationLevel.Complete));
            sc.setEvent("id1", "value", "blah blah");
            sc.setEvent("id2", "value", "blah blah blah");
            d   = sc.getDocJMFNotification(false);
            jmf = d.getJMFRoot();
            Assert.AreEqual(2, jmf.numChildElements(ElementName.SIGNAL,null));
            sc.setEvent("id2","value","blah blah blah");
            d   = sc.getDocJMFNotification(true);
            jmf = d.getJMFRoot();
            Assert.AreEqual(3,jmf.numChildElements(ElementName.SIGNAL,null));
            d = sc.getDocJMFNotification(true);
            Assert.IsNull(d);
        }
Пример #10
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);
        }
Пример #11
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);
        }
Пример #12
0
        public virtual void testUsageCounter()
        {
            JDFDoc doc = new JDFDoc(ElementName.JMF);
            JDFJMF jmf = doc.getJMFRoot();

            JDFSignal s = jmf.appendSignal();

            jmf.setSenderID("DeviceSenderID");

            s.setType(EnumType.Resource);
            JDFResourceQuParams rqp = s.appendResourceQuParams();

            rqp.setJobID("JobID");
            rqp.setJobPartID("JobPartID");
            rqp.setResourceName(ElementName.USAGECOUNTER);

            JDFResourceInfo ri = s.appendResourceInfo();

            ri.setActualAmount(42);
            JDFUsageCounter uc = (JDFUsageCounter)ri.appendElement(ElementName.USAGECOUNTER);

            uc.setID("UsageCounterID");
            uc.setScope(EnumScope.Job);
            uc.setCounterID("DeviceCounterID");
            uc.setResStatus(EnumResStatus.Available, true);
            uc.setCounterTypes(new VString("NormalSize", " "));
            doc.write2File(sm_dirTestDataTemp + "JMFResourceSignal.jmf", 2, false);
            Assert.IsTrue(jmf.isValid(EnumValidationLevel.Complete));
        }
Пример #13
0
        public virtual void testValidateExtensionschema()
        {
            JDFDoc       doc      = new JDFDoc("JDF");
            JDFValidator checkJDF = new JDFValidator();

            checkJDF.setPrint(false);
            checkJDF.bQuiet = true;
            checkJDF.level  = EnumValidationLevel.Incomplete;
            DirectoryInfo foo = new DirectoryInfo(sm_dirTestSchema);

            Assert.IsTrue(foo.Exists, "please mount the svn schema parallel to JDFLibNet");
            FileInfo jdfxsd = new FileInfo(sm_dirTestSchema + "JDF.xsd");

            checkJDF.setJDFSchemaLocation(jdfxsd);
            JDFNode n = doc.getJDFRoot();

            n.setType(EnumType.ConventionalPrinting);
            JDFMedia med = (JDFMedia)n.addResource("Media", null, EnumUsage.Input, null, null, null, null);

            checkJDF.setIgnorePrivate(false);
            doc.write2File(sm_dirTestDataTemp + "extension.jdf", 0, true);
            XMLDoc @out = checkJDF.processSingleFile(sm_dirTestDataTemp + "extension.jdf");

            Assert.AreEqual(@out.getRoot().getXPathAttribute("TestFile/SchemaValidationOutput/@ValidationResult", null), "Valid");

            checkJDF.schemaLocation += " http://www.extension.com " + sm_dirTestData + "extension.xsd";
            med.setAttribute("ext:ExtensionAtt", "a", "http://www.extension.com");
            KElement fooBar = med.appendElement("ext:FooBar", "http://www.extension.com");

            fooBar.setAttribute("ID", "f1");
            fooBar.setAttribute("Fnarf", "4");

            doc.write2File(sm_dirTestDataTemp + "extension.jdf", 0, true);
            @out = checkJDF.processSingleFile(sm_dirTestDataTemp + "extension.jdf");
            Assert.AreEqual(@out.getRoot().getXPathAttribute("TestFile[2]/SchemaValidationOutput/@ValidationResult", null), "Error");

            med.setAttribute("ext:ExtensionAtt", "3", "http://www.extension.com");
            doc.write2File(sm_dirTestDataTemp + "extension.jdf", 0, true);
            @out = checkJDF.processSingleFile(sm_dirTestDataTemp + "extension.jdf");
            Assert.AreEqual(@out.getRoot().getXPathAttribute("TestFile[3]/SchemaValidationOutput/@ValidationResult", null), "Valid");

            fooBar.setAttribute("Fnarf", "bad");
            doc.write2File(sm_dirTestDataTemp + "extension.jdf", 0, true);
            @out = checkJDF.processSingleFile(sm_dirTestDataTemp + "extension.jdf");
            Assert.AreEqual(@out.getRoot().getXPathAttribute("TestFile[4]/SchemaValidationOutput/@ValidationResult", null), "Error");
        }
Пример #14
0
        public virtual void testSubAssemblySection()
        {
            JDFAssemblySection ass  = @as.appendAssemblySection();
            JDFAssemblySection asss = ass.appendAssemblySection();

            asss.setAssemblyIDs(new VString("a b c", " "));
            Assert.IsTrue(@as.isValid(EnumValidationLevel.Incomplete));
            doc.write2File(sm_dirTestDataTemp + "AssemblySection.jdf", 2, false);
        }
Пример #15
0
        public virtual void testEmptyNamespace()
        {
            JDFDoc jdfDoc = new JDFDoc(ElementName.JDF);

            jdfDoc.write2File(sm_dirTestDataTemp + "test.jdf", 0, true);

            FileStream reader = null;

            try
            {
                reader = new FileStream(sm_dirTestDataTemp + "test.jdf", FileMode.Open);

                byte[] buf       = new byte[500];
                int    readChars = reader.Read(buf, 0, 500);

                if (readChars >= 0)
                {
                    string xml         = Encoding.Default.GetString(buf);
                    int    startPoint  = xml.IndexOf("<AuditPool>");
                    bool   namespaceOk = startPoint >= 0;

                    // Xerces 2.0.1 test.jdf contains <AuditPool xmlns="">
                    // Xerces 2.2.1 test.jdf contains <AuditPool>, which is correct

                    if (!namespaceOk)
                    {
                        string help = xml.Substring(xml.IndexOf("<AuditPool"));
                        Assert.IsTrue(namespaceOk, "This version of Apache Xerces has a namespace problem : " + help);
                    }
                }
            }
            catch (FileNotFoundException e)
            {
                SupportClass.WriteStackTrace(e, Console.Error);
            }
            catch (IOException e)
            {
                SupportClass.WriteStackTrace(e, Console.Error);
            }
            finally
            {
                try
                {
                    if (reader != null)
                    {
                        reader.Close();
                    }
                }
                catch (IOException e)
                {
                    // TODO Auto-generated catch block
                    SupportClass.WriteStackTrace(e, Console.Error);
                }
            }
        }
Пример #16
0
        public virtual void testAmountPalletteCompleteManifest()
        {
            JDFElement.setLongID(false);
            JDFDoc  d = new JDFDoc("JDF");
            JDFNode n = d.getJDFRoot();

            n.setType(EnumType.ProcessGroup);
            n.setTypes(new VString("Binding Stacking BoxPacking Palletizing", " "));
            JDFComponent    comp = (JDFComponent)n.addResource(ElementName.COMPONENT, null, EnumUsage.Output, null, null, null, null);
            JDFResourceLink rl   = n.getLink(comp, null);

            rl.setAmount(2, null);
            rl.setDescriptiveName("The link point to 2 pallets with a total comtent of 10000 brochures in 200 boxes");
            JDFComponent compBrochure = (JDFComponent)n.addResource(ElementName.COMPONENT, null, EnumUsage.Input, null, null, null, null);

            compBrochure.setResStatus(EnumResStatus.Available, true);
            compBrochure.setDescriptiveName("The individual Brochures");
            JDFResourceLink rlB = n.getLink(compBrochure, null);

            rlB.setAmount(10000, null);
            rlB.setActualAmount(9700, null);

            for (int i = 0; i < 2; i++)
            {
                // create a pallet partition - may also use the root
                JDFComponent compPallet = (JDFComponent)comp.addPartition(EnumPartIDKey.DeliveryUnit0, "Pallet" + i);
                compPallet.setProductID("Pallet_" + i);

                JDFBundle bundlePallet = compPallet.getCreateBundle();
                int       nBox         = i == 0 ? 100 : 94;
                bundlePallet.setDescriptiveName("Pallet Bundle describing " + nBox + " boxes with " + nBox * 50 + " Brochures Contents total");
                bundlePallet.setTotalAmount(nBox * 50);
                bundlePallet.setBundleType(EnumBundleType.Pallet);

                for (int j = 0; j < nBox; j++)
                {
                    JDFBundleItem biBoxes = bundlePallet.appendBundleItem();
                    JDFComponent  compBox = (JDFComponent)compPallet.addPartition(EnumPartIDKey.DeliveryUnit1, "Box_" + i + "_" + j);
                    compBox.setProductID("Box_" + i + "_" + j);
                    biBoxes.refElement(compBox);
                    biBoxes.setAmount(1);

                    JDFBundle bundleBox = compBox.appendBundle();
                    bundleBox.setDescriptiveName("Bundle describing box #" + j + " with 50 Brochures Contents per box");
                    bundleBox.setTotalAmount(50);
                    bundleBox.setBundleType(EnumBundleType.Box);

                    JDFBundleItem biBrochures = bundleBox.appendBundleItem();
                    biBrochures.refElement(compBrochure);
                    biBrochures.setAmount(50);
                }
            }

            d.write2File(sm_dirTestDataTemp + "MISFinAmountCompleteManifest.jdf", 2, false);
        }
Пример #17
0
        public virtual void testStatusDetails()
        {
            JDFDeviceInfo di = signal.appendDeviceInfo();

            di.setDeviceCondition(EnumDeviceCondition.NeedsAttention);
            di.setDeviceStatus(EnumDeviceStatus.Stopped);
            di.setStatusDetails("OutputAreaFull PaperJam Repair");

            doc.write2File(sm_dirTestDataTemp + "JMFStatusSignal.jmf", 2, false);
            Assert.IsTrue(jmf.isValid(EnumValidationLevel.Complete));
        }
Пример #18
0
        public void testColorantAlias()
        {
            JDFColorantAlias ca = colControl.appendColorantAlias();

            ca.setXMLComment("ColorantAlias that maps the predefined separation Black");
            ca.setReplacementColorantName("Green");
            Assert.IsTrue(ca.isValid(EnumValidationLevel.Incomplete));
            Assert.IsFalse(ca.isValid(EnumValidationLevel.Complete));
            VString vAlias = new VString("Grün grün", null);

            ca.setSeparations(vAlias);
            Assert.IsTrue(ca.isValid(EnumValidationLevel.Complete));
            byte[] b        = Encoding.Default.GetBytes(vAlias.stringAt(0));
            string rawNames = StringUtil.setHexBinaryBytes(b, -1) + " ";

            b         = Encoding.Default.GetBytes(vAlias.stringAt(1));
            rawNames += StringUtil.setHexBinaryBytes(b, -1);
            Assert.IsTrue(ca.isValid(EnumValidationLevel.Complete));
            ca.setAttribute("RawNames", rawNames);

            d.write2File(sm_dirTestDataTemp + "ColorantAlias.jdf", 2, false);
        }
Пример #19
0
        public virtual void testDieLayoutStrip()
        {
            JDFBinderySignature bs = stripParams.appendBinderySignature();

            bs.setBinderySignatureType(EnumBinderySignatureType.Die);
            JDFDieLayout dl = bs.appendDieLayout();
            JDFStation   s  = dl.appendStation();

            s.setStationAmount(12);
            s.setStationName("MyStation");
            JDFSignatureCell[] scs = new JDFSignatureCell[3];
            JDFPreview         pv0 = (JDFPreview)n.addResource(ElementName.PREVIEW, null, null, null, null, null, null);

            string[] index = { "0 ~ 2", "3 ~ 8", "9 ~ 11" };
            for (int i = 0; i < 3; i++)
            {
                JDFSignatureCell sc = scs[i] = bs.appendSignatureCell();
                sc.setStationName("MyStation");
                JDFPreview pv = (JDFPreview)pv0.addPartition(EnumPartIDKey.CellIndex, index[i]);
                pv.setURL("file://foo" + i + ".vrml");
                pv.setAttribute("PreviewFileType", "VRML");
                pv.setAttribute("PreviewUsage", "Animation");
                sc.refElement(pv);
            }

            scs[0].setXMLComment("This represents 3 times pageList 0");
            scs[0].setDescriptiveName("Strawberry lid");
            scs[0].setFrontPages(new JDFIntegerList("0 0 0"));

            scs[1].setFrontPages(new JDFIntegerList("1 1 1 1 1 1"));
            scs[1].setXMLComment("This represents 6 times pageList 1");
            scs[1].setDescriptiveName("Raspberry lid");

            scs[2].setFrontPages(new JDFIntegerList("2 2 2"));
            scs[2].setXMLComment("This represents 3 times pageList 2");
            scs[2].setDescriptiveName("Blueberry lid");

            d.write2File(sm_dirTestDataTemp + "DieStationStrip.jdf", 2, false);
        }
Пример #20
0
        public virtual void testContentDataFinishing()
        {
            testContentData();
            JDFComponent c  = (JDFComponent)n.addResource(ElementName.COMPONENT, EnumUsage.Output);
            JDFComponent c1 = (JDFComponent)c.addPartition(EnumPartIDKey.BlockName, "Stack1");
            JDFComponent c2 = (JDFComponent)c.addPartition(EnumPartIDKey.BlockName, "Stack2");

            c.refElement(pl);
            c1.setPageListIndex(new JDFIntegerRangeList("0~8"));
            c2.setPageListIndex(new JDFIntegerRangeList("9~16"));
            c.setXMLComment("this is the output component with two stacks\n the imposition engine is aware of the pagelist index and can set it appropriately");
            d.write2File(sm_dirTestDataTemp + "ContentMetaDataStack.jdf", 2, false);
        }
Пример #21
0
        public virtual void testContentData()
        {
            d = new JDFDoc("JDF");
            n = d.getJDFRoot();
            n.setType(EnumType.Approval);
            JDFRunList rl = (JDFRunList)n.addResource(ElementName.RUNLIST, EnumUsage.Input);

            pl = rl.appendPageList();
            pl.makeRootResource("PageList", null, true);

            cl = pl.appendContentList();
            cl.makeRootResource("ContentList", null, true);
            JDFContentData cd0 = cl.appendContentData();

            cd0.setAttribute(AttributeName.CONTENTLISTINDEX, "1 2 3");
            KElement book = cd0.appendElement("ContentMetaData");

            book.setAttribute("ISBN", "0123456789");
            JDFComment abstrakt = (JDFComment)book.appendElement("Comment");

            abstrakt.setName("Abstract");
            abstrakt.setText("Abstract of the book\nin english");
            JDFEmployee editor = (JDFEmployee)book.appendElement(ElementName.EMPLOYEE);

            editor.appendPerson().setFamilyName("authorName");
            editor.setRoles(new VString("Editor", null));
            book.setAttribute("Title", "book thing");
            int p = 1;

            for (int i = 1; i < 4; i++)
            {
                JDFContentData cd = cl.appendContentData();
                cd.setAttribute("ID", "CD_" + i);
                KElement chap = cd.appendElement("ContentMetaData");
                chap.setAttribute("Title", "Chapter " + i);
                JDFEmployee author = (JDFEmployee)chap.appendElement(ElementName.EMPLOYEE);
                author.appendPerson().setFamilyName("authorName" + i);
                author.setRoles(new VString("Author", null));

                JDFPageData         pd = pl.appendPageData();
                JDFIntegerRangeList integerRangeList = new JDFIntegerRangeList();
                integerRangeList.Append(p, p + i);
                p += i + 1;
                pd.setAttribute("PageIndex", integerRangeList.ToString());
                JDFPageElement pe = pd.appendPageElement();
                pe.setAttribute("ContentDataRefs", cd.getID());
            }
            pl.setXMLComment("Note that multiple page elements may but need not be specified\nit is also possible to reference only on pageEleemnt that spans the entire book");

            d.write2File(sm_dirTestDataTemp + "ContentMetaData.jdf", 2, false);
        }
Пример #22
0
        public virtual void testAuditsImageSetting()
        {
            for (int i = 0; i < vsSheet.Count; i++)
            {
                string           sheet        = vsSheet.stringAt(i);
                VJDFAttributeMap vmP          = new VJDFAttributeMap();
                JDFAttributeMap  attributeMap = new JDFAttributeMap(EnumPartIDKey.SheetName, sheet);
                attributeMap.put("SignatureName", "Sig1");

                vmP.Add(attributeMap);
                statCounter.setActiveNode(n, vmP, vRL);
                string refXM    = rlXMOut.getrRef();
                string refMedia = rlMediaIn.getrRef();

                statCounter.setTrackWaste(refXM, true);
                statCounter.setTrackWaste(refMedia, false);

                statCounter.setPhase(EnumNodeStatus.Stopped, "PowerOn", EnumDeviceStatus.Stopped, "PowerOn");

                statCounter.setPhase(EnumNodeStatus.InProgress, "Imaging", EnumDeviceStatus.Running, null);
                statCounter.addPhase(refMedia, 5, 0, true);
                statCounter.addPhase(refXM, 5, 0, true);
                statCounter.setPhase(EnumNodeStatus.InProgress, "Imaging", EnumDeviceStatus.Running, null);

                // JDFResourceAudit ra=
                statCounter.setResourceAudit(refMedia, EnumReason.ProcessResult);

                JDFProcessRun pr = statCounter.setProcessResult(EnumNodeStatus.Completed);
                pr.setDescriptiveName("we even have the utterly useless ProcessRun");
            }
            d.write2File(sm_dirTestDataTemp + "ImageSetAmount_.jdf", 2, false);
            JDFDoc d2  = statCounter.getDocJMFResource();
            JDFJMF jmf = d2.getJMFRoot();

            jmf.convertResponses(null);
            JDFSignal       sig = jmf.appendSignal(org.cip4.jdflib.jmf.JDFMessage.EnumType.Notification);
            JDFNotification not = sig.appendNotification();

            not.setXPathAttribute("MileStone/@MileStoneType", "PrepressCompleted");
            not.setXPathAttribute("MileStone/@Amount", "5");
            d2.write2File(sm_dirTestDataTemp + "ImageSetAmount_.jmf", 2, false);
            JDFDoc dStatusJMF = statCounter.getDocJMFPhaseTime();

            jmf = dStatusJMF.getJMFRoot();
            jmf.convertResponses(null);
            dStatusJMF.write2File(sm_dirTestDataTemp + "ImageSetPhaseTime_.jmf", 2, false);
        }
Пример #23
0
        public virtual void testWebGrowthCompensation()
        {
            JDFElement.setLongID(false);
            doc = new JDFDoc("JDF");
            JDFNode         n    = doc.getJDFRoot();
            JDFResourcePool rp   = n.getCreateResourcePool();
            JDFResource     lo   = n.addResource("Layout", EnumResourceClass.Parameter, EnumUsage.Input, null, null, null, null);
            JDFLayout       losh = (JDFLayout)lo.addPartition(EnumPartIDKey.SheetName, "Sheet1");
            JDFLayout       lofr = (JDFLayout)losh.addPartition(EnumPartIDKey.Side, EnumSide.Front.getName());

            rp.appendXMLComment("LayoutShift SHOULD be partitioned: at least Side and Separation will make sense", null);

            JDFResource los = n.addResource("LayoutShift", EnumResourceClass.Parameter, EnumUsage.Input, null, null, null, null);

            los.appendXMLComment("Note that the interpolation algorithm between positions is implementation dependent", null);
            los = los.addPartition(EnumPartIDKey.Side, "Front");
            VString vSep = new VString("Cyan Magenta Yellow Black", " ");

            for (int i = 0; i < 16; i++)
            {
                int x               = 720 * (i % 4);
                int y               = 1000 * (i / 4);
                int ord             = i % 8;
                JDFContentObject co = lofr.appendContentObject();
                co.setOrd(ord);
                co.setOrdID(i);
                co.setCTM(new JDFMatrix(1, 0, 0, 1, x, y));
                JDFMarkObject mo = lofr.appendMarkObject();
                mo.setOrd(ord);
                mo.setOrdID(i + 100);
                mo.setCTM(new JDFMatrix(1, 0, 0, 1, x + 700, y + 900));
            }
            for (int j = 0; j < vSep.Count; j++)
            {
                KElement sepShift = los.addPartition(EnumPartIDKey.Separation, vSep.stringAt(j));
                for (int i = 0; i < 16; i += 2)
                {
                    int      x           = 720 * (i % 4);
                    int      y           = 1000 * (i / 4);
                    KElement shiftObject = sepShift.appendElement("ShiftPoint");

                    shiftObject.setAttribute("Position", new JDFXYPair(x + 360, y + 500).ToString());
                    shiftObject.setAttribute("CTM", new JDFMatrix(1, 0, 0, 1, j + i / 4, j + i % 4).ToString());
                }
            }
            doc.write2File(sm_dirTestDataTemp + "WebgrowthPartition.jdf", 2, false);
        }
Пример #24
0
        public virtual void testUsageCounterDevCaps()
        {
            JDFDoc       duc       = new JDFDoc("DeviceCap");
            JDFDeviceCap devicecap = (JDFDeviceCap)duc.getRoot();
            JDFDevCaps   dcs       = devicecap.appendDevCaps();

            dcs.setName(ElementName.USAGECOUNTER);
            JDFDevCap dc = dcs.appendDevCapInPool();

            dc.setMinOccurs(3);
            dc.setMaxOccurs(3);
            JDFNameState counterID = dc.appendNameState(AttributeName.COUNTERID);

            counterID.setAllowedValueList(new VString("ID_Black ID_Color ID_Total", null));
            counterID.setListType(EnumListType.SingleValue);
            duc.write2File(sm_dirTestDataTemp + "DevCapUsageCounter.jdf", 2, false);
        }
Пример #25
0
        public virtual void testDefaultNamespace()
        {
            JDFDoc jdfDoc = new JDFDoc(ElementName.JDF);

            string defaultFile = "default.jdf";

            jdfDoc.write2File(sm_dirTestDataTemp + defaultFile, 0, true);

            JDFParser p            = new JDFParser();
            JDFDoc    jdfDocResult = p.parseFile(sm_dirTestDataTemp + defaultFile);

            jdfDocResult.getRoot();

            // assertXMLEqual (jdfDocResult.getMemberDocument (),
            // jdfDoc.getMemberDocument ());
            Assert.AreEqual(jdfDocResult.getDocumentElement().NamespaceURI, jdfDoc.getDocumentElement().NamespaceURI);
        }
Пример #26
0
        public virtual void testAmount()
        {
            JDFElement.setLongID(false);
            JDFDoc  d = new JDFDoc("JDF");
            JDFNode n = d.getJDFRoot();

            n.setType(EnumType.ProcessGroup);
            n.setTypes(new VString("Binding Stacking BoxPacking Palletizing", " "));
            JDFComponent    comp = (JDFComponent)n.addResource(ElementName.COMPONENT, null, EnumUsage.Output, null, null, null, null);
            JDFResourceLink rl   = n.getLink(comp, null);

            rl.setAmount(2, null);
            rl.setDescriptiveName("The link point to 2 pallets with a total comtent of 10000 brochures in 200 boxes");

            // create a pallet partition - may also use the root
            JDFComponent compPallet = (JDFComponent)comp.addPartition(EnumPartIDKey.DeliveryUnit0, "Pallet");

            JDFComponent compBox      = (JDFComponent)compPallet.addPartition(EnumPartIDKey.DeliveryUnit1, "Box");
            JDFBundle    bundlePallet = compPallet.appendBundle();

            bundlePallet.setDescriptiveName("Bundle describing 100 boxes with 5000 Brochures Contents total");
            bundlePallet.setTotalAmount(5000);
            bundlePallet.setBundleType(EnumBundleType.Pallet);
            JDFBundleItem biBoxes = bundlePallet.appendBundleItem();

            biBoxes.refElement(compBox);
            biBoxes.setAmount(100);

            JDFComponent compBrochure = (JDFComponent)compBox.addPartition(EnumPartIDKey.DeliveryUnit2, "Brochure");
            JDFBundle    bundleBox    = compBox.appendBundle();

            bundleBox.setDescriptiveName("Bundle describing 1 boxes with 50 Brochures Contents per box");
            bundleBox.setTotalAmount(50);
            bundleBox.setBundleType(EnumBundleType.Box);

            JDFBundleItem biBrochures = bundleBox.appendBundleItem();

            biBrochures.refElement(compBrochure);
            biBrochures.setAmount(50);

            JDFBundle bundleBrochure = compBrochure.appendBundle();

            bundleBrochure.setDescriptiveName("Dummy Bundle to inhibit inheritence of the box Bundle");
            d.write2File(sm_dirTestDataTemp + "MISFinAmount.jdf", 2, false);
        }
Пример #27
0
        public virtual void testLayoutPreflight()
        {
            JDFElement.setLongID(false);
            JDFDoc d = new JDFDoc("JDF");

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

            JDFRunList outRun = (JDFRunList)n.appendMatchingResource(ElementName.RUNLIST, EnumProcessUsage.AnyOutput, null);

            outRun.setFileURL("output.pdf");

            JDFLayoutElementProductionParams lep = (JDFLayoutElementProductionParams)n.appendMatchingResource(ElementName.LAYOUTELEMENTPRODUCTIONPARAMS, EnumProcessUsage.AnyInput, null);
            JDFComment com = lep.appendComment();

            com.setName("Instruction");
            com.setText("Add any human readable instructions here");

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

            // now some simple tests...
            appendNumPagesAction();
            appendSeparationAction();
            appendBWSeparationAction();
            appendTrimBoxAction();
            appendResolutionAction();
            StatusUtil su = new StatusUtil(n, null, null);

            su.setPhase(EnumNodeStatus.InProgress, "Creative Work", EnumDeviceStatus.Running, null, null);

            su.getDocJMFPhaseTime();
            Thread.Sleep(1000);
            su = new StatusUtil(n, null, null);
            su.setPhase(EnumNodeStatus.InProgress, "Creative Work", EnumDeviceStatus.Running, null, null);
            su.getDocJMFPhaseTime();
            Thread.Sleep(1000);
            su = new StatusUtil(n, null, null);
            su.setPhase(EnumNodeStatus.Completed, "done", EnumDeviceStatus.Idle, null, null);
            su.getDocJMFPhaseTime();
            d.write2File(sm_dirTestDataTemp + "LayoutPreflight.jdf", 2, false);
        }
Пример #28
0
        public virtual void testPlannedWaste()
        {
            JDFElement.setLongID(false);
            d = new JDFDoc("JDF");
            n = d.getJDFRoot();
            n.setType(EnumType.ConventionalPrinting);
            outComp = (JDFComponent)n.addResource(ElementName.COMPONENT, null, EnumUsage.Output, null, null, null, null);
            rlOut   = n.getLink(outComp, null);
            JDFAmountPool ap = rlOut.getCreateAmountPool();

            JDFComponent    cover = (JDFComponent)outComp.addPartition(EnumPartIDKey.SheetName, "Cover");
            JDFAttributeMap map   = cover.getPartMap();

            ap.appendXMLComment("Want 10000-10500 good cover sheets and allow for 500 waste cover sheets", null);
            map.put(EnumPartIDKey.Condition, "Good");
            rlOut.setAmount(10000, map);
            rlOut.setMaxAmount(10500, map);
            map.put(EnumPartIDKey.Condition, "Waste");
            rlOut.setMaxAmount(500, map);

            ap.appendXMLComment("Want 20000 good first insert sheets and allow for 200 waste insert sheets", null);
            JDFComponent sheet1 = (JDFComponent)outComp.addPartition(EnumPartIDKey.SheetName, "Sheet1");

            map = sheet1.getPartMap();
            map.put(EnumPartIDKey.Condition, "Good");
            rlOut.setAmount(20000, map);
            map.put(EnumPartIDKey.Condition, "Waste");
            rlOut.setMaxAmount(200, map);

            ap.appendXMLComment("Want 20000 good second insert sheets and allow for 200 waste insert sheets", null);
            JDFComponent sheet2 = (JDFComponent)outComp.addPartition(EnumPartIDKey.SheetName, "Sheet2");

            map = sheet2.getPartMap();
            map.put(EnumPartIDKey.Condition, "Good");
            rlOut.setAmount(20000, map);
            map.put(EnumPartIDKey.Condition, "Waste");
            rlOut.setMaxAmount(100, map);

            d.write2File(sm_dirTestDataTemp + "plannedWaste.jdf", 2, true);
        }
Пример #29
0
        public virtual void testModules()
        {
            JDFAuditPool ap = n.getCreateAuditPool();

            ap.appendXMLComment("JDF 1.3 compatible auditing of module phases - note that modulephase start and end times are set outside of the phasetime start and end times", null);
            JDFPhaseTime   pt     = ap.addPhaseTime(EnumNodeStatus.Setup, null, null);
            JDFPhaseTime   pt2    = ap.addPhaseTime(EnumNodeStatus.InProgress, null, null);
            JDFDate        date   = new JDFDate();
            JDFModulePhase mpRIP  = pt.appendModulePhase();
            JDFModulePhase mpRIP2 = pt2.appendModulePhase();

            mpRIP.setStatus(EnumNodeStatus.InProgress);
            mpRIP2.setStatus(EnumNodeStatus.InProgress);
            mpRIP2.setDescriptiveName("This ModulePhase is actually the same as the initial ModulePhase in the setup PhaseTime");
            mpRIP.setModuleType("Imaging");
            mpRIP2.setModuleType("Imaging");
            pt.setStart(date);
            mpRIP.setStart(date);
            mpRIP2.setStart(date);
            date.addOffset(0, 5, 0, 0);
            pt.setEnd(date);

            JDFModulePhase mpPrint = pt2.appendModulePhase();

            mpPrint.setStatus(EnumNodeStatus.InProgress);
            pt2.setStart(date);
            mpPrint.setStart(date);
            date.addOffset(0, 30, 0, 0);
            mpRIP.setEnd(date);
            mpRIP2.setEnd(date);

            date.addOffset(0, 70, 0, 0);
            pt2.setEnd(date);
            mpPrint.setEnd(date);
            mpPrint.setModuleType("Printer");
            doc.write2File(sm_dirTestDataTemp + "DigiPrintModule1.jdf", 2, false);
        }
Пример #30
0
        public virtual void testMediaCatalog()
        {
            JDFDoc doc = new JDFDoc(ElementName.JMF);
            JDFJMF jmf = doc.getJMFRoot();

            jmf.setSenderID("DeviceSenderID");

            JDFQuery q = jmf.appendQuery(EnumType.Resource);

            q.setXMLComment("This is the query for a catalog");

            JDFResourceQuParams rqp = q.appendResourceQuParams();

            rqp.setExact(true);
            rqp.setXMLComment("Scope=Allowed is a new attribute to describe that we want a complet list of all known resources");
            rqp.setResourceName(ElementName.MEDIA);
            //		rqp.setAttribute("Scope", "Allowed");

            JDFResponse r = q.createResponse().getResponse(0);

            r = (JDFResponse)jmf.moveElement(r, null);
            r.setXMLComment("This is the response to the query - generally it will be in it's own jmf...\nThe list of ResourceInfo + the ResourceQuParams could also be specified in a Signal.");

            for (int i = 1; i < 5; i++)
            {
                JDFResourceInfo ri = r.appendResourceInfo();
                ri.setResourceName("Media");
                JDFMedia m = (JDFMedia)ri.appendResource("Media");
                m.setDescriptiveName("Description of Media #" + i);
                m.setDimensionCM(new JDFXYPair(i * 10, 13 + i % 2 * 20));
                m.setBrand("Brand #" + i);
                m.setProductID("ProductID_" + i);
                m.setMediaType(EnumMediaType.Paper);
                m.setResStatus((i < 2 ? EnumResStatus.Available : EnumResStatus.Unavailable), false);
                ri.setXMLComment("More attributes can be added as needed; Available = loaded");
            }
            doc.write2File(sm_dirTestDataTemp + "MediaCatalog.jmf", 2, false);
            Assert.IsTrue(jmf.isValid(EnumValidationLevel.Complete));
        }