private void initDao() { try { collectionDataDao = new CollectionDataDao(); collectionDataDao.openDB(this); } catch (Exception e) { ADLog.error("初始Dao异常", e); } }
private void initData(int node) { try { List<CollectionDataDO> res = collectionDataDao.findPage(1, 0, "" + node); // txtnode, txtstutas, txtvol, txthum, txttemp, txtbrt if (null == res || res.size() == 0) { txtnode.setText("node-" + node); txtstutas.setText("N/A"); txtvol.setText("N/A"); txthum.setText("N/A"); txttemp.setText("N/A"); txtbrt.setText("N/A"); } else { txtnode.setText("node-" + node); txtstutas.setText("ok"); txtvol.setText("" + res.get(0).getDvoltage()); txthum.setText("" + res.get(0).getDhumidity()); txttemp.setText("" + res.get(0).getDtemperature()); txtbrt.setText("" + res.get(0).getDbrightness()); } } catch (Exception e) { ADLog.error("初始数据异常", e); } }