Exemplo n.º 1
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);
        }
Exemplo n.º 2
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);
        }