示例#1
0
        public virtual void testAutomatedStrippingCutAndStack()
        {
            n.setType(EnumType.Stripping);
            stripParams = (JDFStrippingParams)n.addResource(ElementName.STRIPPINGPARAMS, null, EnumUsage.Input, null, null, null, null);
            stripParams.getParentNode_KElement().appendXMLComment("Simple automated StrippingParams for the cut&stack example layout\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");
            JDFStrippingParams stripStack0 = (JDFStrippingParams)stripSheet.addPartition(EnumPartIDKey.BinderySignatureName, "Stack0");

            stripParams.setAttribute("StackDepth", "100");

            JDFBinderySignature binderySignature = stripStack0.appendBinderySignature();

            stripStack0.appendPosition().setRelativeBox(new JDFRectangle(0, 0, 0.5, 1));
            binderySignature = (JDFBinderySignature)binderySignature.makeRootResource(null, null, true);
            binderySignature.setNumberUp(new JDFXYPair(1, 1));
            JDFStrippingParams stripStack1 = (JDFStrippingParams)stripSheet.addPartition(EnumPartIDKey.BinderySignatureName, "Stack1");

            stripStack1.refElement(binderySignature);
            stripStack1.appendPosition().setRelativeBox(new JDFRectangle(0.5, 0, 1, 1));
            doc.write2File(sm_dirTestDataTemp + "AutomatedStrippingCutStack.jdf", 2, false);
        }
示例#2
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);
 }
示例#3
0
        ///
        ///	 <summary> *  </summary>
        ///
        private void initStrippingParams()
        {
            JDFStrippingParams sp = (JDFStrippingParams)theNode.getCreateResource(ElementName.STRIPPINGPARAMS, EnumUsage.Input, 0);

            sp.setDescriptiveName("Impositioning for job " + theNode.getJobID(true));
            sp.setWorkStyle(org.cip4.jdflib.auto.JDFAutoStrippingParams.EnumWorkStyle.getEnum(workStyle.getValue()));
            // VJDFAttributeMap reduceMap=
            getReducedMap(new VString("Separation PartVersion", null));
            JDFBinderySignature bs0 = (JDFBinderySignature)theNode.getResource(ElementName.BINDERYSIGNATURE, EnumUsage.Input, 0);
            JDFBinderySignature bs1 = (JDFBinderySignature)theNode.getResource(ElementName.BINDERYSIGNATURE, EnumUsage.Input, 1);

            if (bs1 == null)
            {
                bs1 = bs0;
            }

            if (vParts != null)
            {
                VJDFAttributeMap reducedMap = getReducedMap(new VString("Side Separation PartVersion", " "));
                if (reducedMap != null)
                {
                    int size = reducedMap.Count;
                    for (int i = 0; i < size; i++)
                    {
                        JDFAttributeMap     part   = reducedMap[i];
                        JDFResource         partSP = sp.getCreatePartition(part, partIDKeys);
                        JDFBinderySignature bs     = partSP.getSheetName().ToLower().Contains("cover") ? bs0 : bs1;
                        partSP.refElement(bs);
                        JDFResourceLink rl = theNode.getLink(bs, null);
                        if (rl != null)
                        {
                            rl.deleteNode();
                        }
                    }
                }
            }
            else
            {
                sp.refElement(bs0);
            }

            sp.appendDevice().setDeviceID("Press_ID");
            sp.appendPosition().setRelativeBox(new JDFRectangle(0, 0, 0.5, 1));
            sp.appendPosition().setRelativeBox(new JDFRectangle(0.5, 1, 1, 1));

            sp.appendStripCellParams().setTrimSize(new JDFXYPair(8.5 * 72, 11 * 72));

            sp.refElement(initPaperMedia());
        }
示例#4
0
        ///
        ///	 <summary> *  </summary>
        ///
        private JDFBinderySignature initBinderySignature(string catalog)
        {
            JDFBinderySignature bs = (JDFBinderySignature)theNode.addResource(ElementName.BINDERYSIGNATURE, EnumUsage.Input);

            bs.setBinderySignatureType(EnumBinderySignatureType.Fold);
            bs.setFoldCatalog(catalog);
            int f = StringUtil.parseInt(StringUtil.token(catalog, 0, "-").Substring(1), 0) / 2;

            if (f > 0)
            {
                int fx = f;
                int fy = 1;
                if (f >= 8)
                {
                    fx /= 2;
                    fy *= 2;
                }
                bs.setNumberUp(new JDFXYPair(fx, fy));
            }

            return(bs);
        }
示例#5
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);
        }
示例#6
0
 ///
 ///      <summary> * (31) create inter-resource link to refTarget </summary>
 ///      * <param name="refTarget"> the element that is referenced </param>
 ///
 public virtual void refBinderySignature(JDFBinderySignature refTarget)
 {
     refElement(refTarget);
 }
示例#7
0
        public virtual void testStripMarks()
        {
            // TODO relativeSize AbsoluteSize NextPosition
            JDFElement.setLongID(false);
            n.getCreateResourcePool().appendXMLComment("StrippingParams with one sheet for simplicity", null);

            JDFMedia media = stripParams.appendMedia();

            media.setDimensionCM(new JDFXYPair(100, 70));

            JDFStrippingParams spS1 = (JDFStrippingParams)stripParams.addPartition(EnumPartIDKey.SheetName, "Sheet_1");
            {
                JDFStripMark sm1 = spS1.appendStripMark();
                sm1.setXMLComment("The following mark is on the press sheet (see new Attribute: MarkContext)\n@Anchor defines the cs origin of the mark, @NextAnchor defines the cs origin of the container, in this case the sheet\nThus the top center of the mark is rotated by 90° and placed exactly on (Position=0 0) the center right of the sheet\nNote that position is defined in absolute coordinates so that it alligns with Margin\nI propose deprecating StripMark/Position because the box paradigm does not fit well with resizeable marks.");
                sm1.setAttribute("MarkContext", "Sheet");
                sm1.setMarkName("ColorControlStrip");
                sm1.setMarkSide(EnumMarkSide.TwoSidedIndependent);
                sm1.setAttribute("Orientation", "Rotate90");
                setNextAnchor(sm1, null, "CenterRight", "0 0", null, "Parent");
                sm1.setAttribute("Anchor", "TopCenter");
                sm1.appendElement(ElementName.COLORCONTROLSTRIP).setXMLComment("The various explicit mark elements should be allowed here for their associated metatdata");
            }

            JDFStrippingParams  spBS1 = (JDFStrippingParams)spS1.addPartition(EnumPartIDKey.BinderySignatureName, "BS_1");
            JDFBinderySignature bs1   = spBS1.appendBinderySignature();

            bs1.setNumberUp(new JDFXYPair(2, 4));
            JDFPosition posBS1_1 = spBS1.appendPosition();

            posBS1_1.setRelativeBox(new JDFRectangle(0, 0, 0.5, 1));
            {
                JDFStripMark sm1_1 = spBS1.appendStripMark();
                sm1_1.setXMLComment("The following describes a back to back mark on the folding signature (see new Attribute: MarkContext)\n@Anchor defines the cs origin of the mark, @NextAnchor defines the cs origin of the container, in this case the bindery signature.\nThus the center of the cutmark is positioned 5 pts left(-5) and 5 pts up(+5) from the bottom right of the bindery Signature");
                sm1_1.setAttribute("MarkContext", "BinderySignature");
                sm1_1.setMarkName("CutMark");
                sm1_1.setMarkSide(EnumMarkSide.TwoSidedBackToBack);
                sm1_1.setAttribute("Orientation", "Rotate0");
                sm1_1.setAttribute("Anchor", "Center");
                setNextAnchor(sm1_1, null, "BottomRight", "-5 5", null, "Parent");
                sm1_1.appendElement(ElementName.CUTMARK).setXMLComment("The various explicit mark elements should be allowed here for their associated metatdata");
            }
            // TODO page cs vs. cell cs
            {
                JDFStripMark sm1_2 = spBS1.appendStripMark();
                sm1_2.setXMLComment("The following describes a 4 back marks, one on each pair of Strip Cells (page) (see new Attribute: MarkContext)\n@Anchor defines the cs origin of the mark, @NextAnchor defines the cs origin of the container, in this case the spine of a pair of Page cells.\nThus the center of the bar code is positioned 0 pts right and 5 point up from the bottom spine of the cell page.\n Position is applied prior to rotating the mark.");
                sm1_2.setAttribute("MarkContext", "CellPair");
                sm1_2.setMarkName("IdentificationField");
                sm1_2.setMarkSide(EnumMarkSide.Back);
                sm1_2.setAttribute("Orientation", "Rotate90");
                sm1_2.setAttribute("Anchor", "CenterLeft");
                setNextAnchor(sm1_2, null, "BottomCenter", "5 0", null, "Parent");
                sm1_2.appendElement(ElementName.IDENTIFICATIONFIELD).setXMLComment("The various explicit mark elements should be allowed here for their associated metatdata");
            }

            {
                JDFStripMark sm1_3 = spBS1.appendStripMark();
                sm1_3.setXMLComment("The following describes a back mark on each of the 8 Strip Cells (page) (see new Attribute: MarkContext)\n@Anchor defines the cs origin of the mark, @NextAnchor defines the cs origin of the container, in this case the bottom center of a Page cell.\nThus the center of the bar code is positioned 0 pts right and 5 point up from the bottom cell page.");
                sm1_3.setAttribute("MarkContext", "Cell");
                sm1_3.setMarkName("IdentificationField");
                sm1_3.setMarkSide(EnumMarkSide.Back);
                sm1_3.setAttribute("Orientation", "Rotate0");
                sm1_3.setAttribute("Anchor", "BottomCenter");
                setNextAnchor(sm1_3, null, "BottomCenter", "0 5", null, "Parent");
                sm1_3.setAttribute("AbsoluteWidth", "20");
                sm1_3.setAttribute("AbsoluteHeight", "10");
                sm1_3.appendElement(ElementName.IDENTIFICATIONFIELD).setXMLComment("The various explicit mark elements should be allowed here for their associated metatdata");
            }

            JDFStrippingParams spBS2 = (JDFStrippingParams)spS1.addPartition(EnumPartIDKey.BinderySignatureName, "BS_2");

            spBS2.appendBinderySignature();
            JDFPosition posBS2_1 = spBS2.appendPosition();

            posBS2_1.setRelativeBox(new JDFRectangle(0.5, 0, 1, 0.5));
            posBS2_1.setOrientation(EnumOrientation.Rotate270);

            JDFPosition posBS2_2 = spBS2.appendPosition();

            posBS2_2.setRelativeBox(new JDFRectangle(0.5, 0.5, 1, 1));
            posBS2_2.setOrientation(EnumOrientation.Flip90);

            {
                JDFStripMark sm2_1 = spBS2.appendStripMark();
                sm2_1.setXMLComment("The following describes single sided barcode on the two folding signatures (see new Attribute: MarkContext)\n@Anchor defines the cs origin of the mark, @NextAnchor defines the cs origin of the container, in this case the 2 bindery signatures.\nThus the top left of the barcode is positioned 3 pts right(+3) and 3 pts below(-3) from the top left of the front side of the bindery Signature.\nSince ther are two position elements, this results in two marks:\nPosition one is rotated by 90 degrees so that the barcode remains on the front of the sheet. Due to the Position/@Rotation, the mark is also rotated by 90° on the press sheet\n Position 2 is also flipped so that the barcode eventually ends up on the back of the press sheet.");
                sm2_1.setAttribute("MarkContext", "BinderySignature");
                sm2_1.setMarkName("IdentificationField");
                sm2_1.setMarkSide(EnumMarkSide.Front);
                sm2_1.setAttribute("Orientation", "Rotate0");
                sm2_1.setAttribute("Anchor", "TopLeft");
                setNextAnchor(sm2_1, null, "TopLeft", "2 -3", null, "Parent");
                string idAnchor = sm2_1.appendAnchor(null);
                sm2_1.appendElement(ElementName.IDENTIFICATIONFIELD).setXMLComment("The various explicit mark elements should be allowed here for their associated metatdata");

                JDFStripMark sm2_2 = spBS2.appendStripMark();
                sm2_2.setXMLComment("The following is a relatively positioned stripmark.");
                sm2_2.setAttribute("MarkContext", "BinderySignature");
                sm2_1.setAttribute("Anchor", "BottomLeft");
                sm2_2.setMarkName("RegisterMark");
                sm2_2.setMarkSide(EnumMarkSide.Front);
                sm2_2.setAttribute("Orientation", "Rotate0");
                sm2_2.appendElement(ElementName.REGISTERMARK).setXMLComment("The various explicit mark elements should be allowed here for their associated metatdata");
                setNextAnchor(sm2_2, idAnchor, "BottomRight", "3 0", "This NextAnchor element refers to the previous barcode. the lower left of this is 3 points tothe right of the lower right of the referenced barcode.", "Sibling");
            }

            d.write2File(sm_dirTestDataTemp + "StripMarks.jdf", 2, false);
        }