Exemplo n.º 1
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());
        }
Exemplo n.º 2
0
        ///
        ///	 <summary> * get a matching device for a given DeviceID
        ///	 *  </summary>
        ///	 * <param name="deviceID"> the deviceID of the device to get </param>
        ///
        public virtual JDFDeviceInfo getDeviceInfo(string deviceID)
        {
            JDFDeviceInfo d = (JDFDeviceInfo)getChildWithAttribute(ElementName.DEVICEINFO, AttributeName.DEVICEID, null, deviceID, 0, true);

            if (d == null)
            {
                JDFDevice dev = (JDFDevice)getChildWithAttribute(ElementName.DEVICE, AttributeName.DEVICEID, null, deviceID, 0, false);
                if (dev != null)
                {
                    d = (JDFDeviceInfo)dev.getParentNode_KElement();
                }
            }
            return(d);
        }