List of usage examples for org.apache.commons.configuration2 AbstractConfiguration getInt
@Override public int getInt(final String key, final int defaultValue)
From source file:org.objectspace.rfid.elatec.ISO15693Elatec.java
/** * //from w w w . j a va2s. co m */ public ISO15693Elatec(AbstractConfiguration config) { this.config = config; elatec = new ElatecRFID(config); readattempts = config.getInt("device.elatec.readattempts", 2); writeattempts = config.getInt("device.elatec.writeattempts", 3); maxBlocksMap = new HashMap<String, Integer>(); if (config != null) { List<Object> tagFeatures = config.getList("tagfeatures.tag.name"); for (int i = 0; i < tagFeatures.size(); i++) { String tagName = config.getString("tagfeatures.tag(" + i + ").name"); int userMemory = config.getInt("tagfeatures.tag(" + i + ").usermemory"); int blockSize = config.getInt("tagfeatures.tag(" + i + ").blocksize"); int blocks = userMemory / (blockSize * 8); maxBlocksMap.put(tagName, blocks); } } }
From source file:org.objectspace.rfid.library.inventory.InventoryThread.java
/** * //from w w w. j a v a 2 s .co m */ public InventoryThread(ISO15693Reader reader, InventoryCallback inventoryCallback, InventoryDialog id, AbstractConfiguration config) { this.reader = reader; this.inventoryCallback = inventoryCallback; this.config = config; this.id = id; numBlocks = config.getInt("numblocks", 8); sleep = config.getInt("inventory.sleep", 400); }
From source file:org.objectspace.rfid.library.taghandle.TagHandleThread.java
/** * @throws SQLException/*from w w w . j ava 2 s .c o m*/ * @throws ClassNotFoundException * @throws IllegalAccessException * @throws InstantiationException * */ public TagHandleThread(ISO15693Reader reader, AbstractConfiguration config, MainDialog mainDialog, WebCamThread wct) throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { this.reader = reader; inventoryCallback = new TagHandleInventory(config, mainDialog, wct); numBlocks = config.getInt("numblocks", 8); sleep = config.getInt("taghandle.sleep", 500); }
From source file:org.objectspace.rfid.library.taghandle.WebCamThread.java
/** * @param config/*from w ww.j a v a 2 s . c o m*/ * @param md * */ public WebCamThread(AbstractConfiguration config, MainDialog md) { this.config = config; this.md = md; canvas = new CanvasFrame(config.getString("taghandle.camera.windowtitle")); canvas.setLocation(config.getInt("taghandle.camera.window.posx", 0), config.getInt("taghandle.camera.window.posy", 0)); canvas.setSize(config.getInt("taghandle.camera.window.width", 640), config.getInt("taghandle.camera.window.height", 480)); sleep = config.getInt("taghandle.camera.sleep", 50); transpose = config.getBoolean("taghandle.camera.transpose", false); flip = config.getInt("taghandle.camera.flip", -2); cropX = config.getInt("taghandle.camera.crop.x", 0); cropY = config.getInt("taghandle.camera.crop.y", 0); cropWidth = config.getInt("taghandle.camera.crop.width", 1080); cropHeight = config.getInt("taghandle.camera.crop.height", 1900); converter = new OpenCVFrameConverter.ToIplImage(); }