diff --git a/app/src/main/cpp/serial_port.cpp b/app/src/main/cpp/serial_port.cpp index 9daa036..6d6601f 100644 --- a/app/src/main/cpp/serial_port.cpp +++ b/app/src/main/cpp/serial_port.cpp @@ -87,7 +87,7 @@ extern "C" JNIEXPORT jobject JNICALL -Java_com_casic_detector_common_uart_SerialPortKit_open(JNIEnv *env, jobject thiz, jstring path, +Java_com_casic_detector_common_uart_JNIKit_open(JNIEnv *env, jobject thiz, jstring path, jint baud_rate, jint flags) { int fd; speed_t speed; @@ -157,7 +157,7 @@ extern "C" JNIEXPORT void JNICALL -Java_com_casic_detector_common_uart_SerialPortKit_close(JNIEnv *env, jobject thiz) { +Java_com_casic_detector_common_uart_JNIKit_close(JNIEnv *env, jobject thiz) { jclass j_fd_class = env->FindClass("java/io/FileDescriptor"); char descriptor_buffer[16] = {0}; diff --git a/app/src/main/cpp/serial_port.cpp b/app/src/main/cpp/serial_port.cpp index 9daa036..6d6601f 100644 --- a/app/src/main/cpp/serial_port.cpp +++ b/app/src/main/cpp/serial_port.cpp @@ -87,7 +87,7 @@ extern "C" JNIEXPORT jobject JNICALL -Java_com_casic_detector_common_uart_SerialPortKit_open(JNIEnv *env, jobject thiz, jstring path, +Java_com_casic_detector_common_uart_JNIKit_open(JNIEnv *env, jobject thiz, jstring path, jint baud_rate, jint flags) { int fd; speed_t speed; @@ -157,7 +157,7 @@ extern "C" JNIEXPORT void JNICALL -Java_com_casic_detector_common_uart_SerialPortKit_close(JNIEnv *env, jobject thiz) { +Java_com_casic_detector_common_uart_JNIKit_close(JNIEnv *env, jobject thiz) { jclass j_fd_class = env->FindClass("java/io/FileDescriptor"); char descriptor_buffer[16] = {0}; diff --git a/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java b/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java index 27e7429..3bba972 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java @@ -13,20 +13,25 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. + /** * Master of DAO (schema version 1): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 1; - /** Creates underlying database table using DAOs. */ + /** + * Creates underlying database table using DAOs. + */ public static void createAllTables(Database db, boolean ifNotExists) { MarkerLocalBeanDao.createTable(db, ifNotExists); TaskLocalBeanDao.createTable(db, ifNotExists); TaskMarkerLocalBeanDao.createTable(db, ifNotExists); } - /** Drops underlying database table using DAOs. */ + /** + * Drops underlying database table using DAOs. + */ public static void dropAllTables(Database db, boolean ifExists) { MarkerLocalBeanDao.dropTable(db, ifExists); TaskLocalBeanDao.dropTable(db, ifExists); @@ -81,7 +86,9 @@ } } - /** WARNING: Drops all table on Upgrade! Use only during development. */ + /** + * WARNING: Drops all table on Upgrade! Use only during development. + */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/cpp/serial_port.cpp b/app/src/main/cpp/serial_port.cpp index 9daa036..6d6601f 100644 --- a/app/src/main/cpp/serial_port.cpp +++ b/app/src/main/cpp/serial_port.cpp @@ -87,7 +87,7 @@ extern "C" JNIEXPORT jobject JNICALL -Java_com_casic_detector_common_uart_SerialPortKit_open(JNIEnv *env, jobject thiz, jstring path, +Java_com_casic_detector_common_uart_JNIKit_open(JNIEnv *env, jobject thiz, jstring path, jint baud_rate, jint flags) { int fd; speed_t speed; @@ -157,7 +157,7 @@ extern "C" JNIEXPORT void JNICALL -Java_com_casic_detector_common_uart_SerialPortKit_close(JNIEnv *env, jobject thiz) { +Java_com_casic_detector_common_uart_JNIKit_close(JNIEnv *env, jobject thiz) { jclass j_fd_class = env->FindClass("java/io/FileDescriptor"); char descriptor_buffer[16] = {0}; diff --git a/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java b/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java index 27e7429..3bba972 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java @@ -13,20 +13,25 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. + /** * Master of DAO (schema version 1): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 1; - /** Creates underlying database table using DAOs. */ + /** + * Creates underlying database table using DAOs. + */ public static void createAllTables(Database db, boolean ifNotExists) { MarkerLocalBeanDao.createTable(db, ifNotExists); TaskLocalBeanDao.createTable(db, ifNotExists); TaskMarkerLocalBeanDao.createTable(db, ifNotExists); } - /** Drops underlying database table using DAOs. */ + /** + * Drops underlying database table using DAOs. + */ public static void dropAllTables(Database db, boolean ifExists) { MarkerLocalBeanDao.dropTable(db, ifExists); TaskLocalBeanDao.dropTable(db, ifExists); @@ -81,7 +86,9 @@ } } - /** WARNING: Drops all table on Upgrade! Use only during development. */ + /** + * WARNING: Drops all table on Upgrade! Use only during development. + */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java b/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java index 7fff4ea..14ecd6c 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -29,8 +29,7 @@ private final TaskLocalBeanDao taskLocalBeanDao; private final TaskMarkerLocalBeanDao taskMarkerLocalBeanDao; - public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> - daoConfigMap) { + public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); markerLocalBeanDaoConfig = daoConfigMap.get(MarkerLocalBeanDao.class).clone(); @@ -50,7 +49,7 @@ registerDao(TaskLocalBean.class, taskLocalBeanDao); registerDao(TaskMarkerLocalBean.class, taskMarkerLocalBeanDao); } - + public void clear() { markerLocalBeanDaoConfig.clearIdentityScope(); taskLocalBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/cpp/serial_port.cpp b/app/src/main/cpp/serial_port.cpp index 9daa036..6d6601f 100644 --- a/app/src/main/cpp/serial_port.cpp +++ b/app/src/main/cpp/serial_port.cpp @@ -87,7 +87,7 @@ extern "C" JNIEXPORT jobject JNICALL -Java_com_casic_detector_common_uart_SerialPortKit_open(JNIEnv *env, jobject thiz, jstring path, +Java_com_casic_detector_common_uart_JNIKit_open(JNIEnv *env, jobject thiz, jstring path, jint baud_rate, jint flags) { int fd; speed_t speed; @@ -157,7 +157,7 @@ extern "C" JNIEXPORT void JNICALL -Java_com_casic_detector_common_uart_SerialPortKit_close(JNIEnv *env, jobject thiz) { +Java_com_casic_detector_common_uart_JNIKit_close(JNIEnv *env, jobject thiz) { jclass j_fd_class = env->FindClass("java/io/FileDescriptor"); char descriptor_buffer[16] = {0}; diff --git a/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java b/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java index 27e7429..3bba972 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java @@ -13,20 +13,25 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. + /** * Master of DAO (schema version 1): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 1; - /** Creates underlying database table using DAOs. */ + /** + * Creates underlying database table using DAOs. + */ public static void createAllTables(Database db, boolean ifNotExists) { MarkerLocalBeanDao.createTable(db, ifNotExists); TaskLocalBeanDao.createTable(db, ifNotExists); TaskMarkerLocalBeanDao.createTable(db, ifNotExists); } - /** Drops underlying database table using DAOs. */ + /** + * Drops underlying database table using DAOs. + */ public static void dropAllTables(Database db, boolean ifExists) { MarkerLocalBeanDao.dropTable(db, ifExists); TaskLocalBeanDao.dropTable(db, ifExists); @@ -81,7 +86,9 @@ } } - /** WARNING: Drops all table on Upgrade! Use only during development. */ + /** + * WARNING: Drops all table on Upgrade! Use only during development. + */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java b/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java index 7fff4ea..14ecd6c 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -29,8 +29,7 @@ private final TaskLocalBeanDao taskLocalBeanDao; private final TaskMarkerLocalBeanDao taskMarkerLocalBeanDao; - public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> - daoConfigMap) { + public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); markerLocalBeanDaoConfig = daoConfigMap.get(MarkerLocalBeanDao.class).clone(); @@ -50,7 +49,7 @@ registerDao(TaskLocalBean.class, taskLocalBeanDao); registerDao(TaskMarkerLocalBean.class, taskMarkerLocalBeanDao); } - + public void clear() { markerLocalBeanDaoConfig.clearIdentityScope(); taskLocalBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java b/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java index 31de1ae..9fd362f 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java +++ b/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java @@ -12,9 +12,10 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** + +/** * DAO for table "MARKER_LOCAL_BEAN". -*/ + */ public class MarkerLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MARKER_LOCAL_BEAN"; @@ -57,14 +58,16 @@ public MarkerLocalBeanDao(DaoConfig config) { super(config); } - + public MarkerLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** Creates the underlying database table. */ + /** + * Creates the underlying database table. + */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; db.execSQL("CREATE TABLE " + constraint + "\"MARKER_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPELINE_TYPE\" TEXT," + // 1: pipelineType @@ -95,7 +98,9 @@ "\"IMAGE_PATH\" TEXT);"); // 26: imagePath } - /** Drops the underlying database table. */ + /** + * Drops the underlying database table. + */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MARKER_LOCAL_BEAN\""; db.execSQL(sql); @@ -104,137 +109,137 @@ @Override protected final void bindValues(DatabaseStatement stmt, MarkerLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipelineType = entity.getPipelineType(); if (pipelineType != null) { stmt.bindString(2, pipelineType); } - + String pipelineDiameter = entity.getPipelineDiameter(); if (pipelineDiameter != null) { stmt.bindString(3, pipelineDiameter); } - + String pipelineMaterial = entity.getPipelineMaterial(); if (pipelineMaterial != null) { stmt.bindString(4, pipelineMaterial); } - + String buryMethod = entity.getBuryMethod(); if (buryMethod != null) { stmt.bindString(5, buryMethod); } - + String buryDepth = entity.getBuryDepth(); if (buryDepth != null) { stmt.bindString(6, buryDepth); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(7, area); } - + String line = entity.getLine(); if (line != null) { stmt.bindString(8, line); } - + String road = entity.getRoad(); if (road != null) { stmt.bindString(9, road); } - + String constructTime = entity.getConstructTime(); if (constructTime != null) { stmt.bindString(10, constructTime); } - + String owner = entity.getOwner(); if (owner != null) { stmt.bindString(11, owner); } - + String objectId = entity.getObjectId(); if (objectId != null) { stmt.bindString(12, objectId); } - + String markerId = entity.getMarkerId(); if (markerId != null) { stmt.bindString(13, markerId); } - + String markerType = entity.getMarkerType(); if (markerType != null) { stmt.bindString(14, markerType); } - + String markerDepth = entity.getMarkerDepth(); if (markerDepth != null) { stmt.bindString(15, markerDepth); } - + String installationDept = entity.getInstallationDept(); if (installationDept != null) { stmt.bindString(16, installationDept); } - + String lng = entity.getLng(); if (lng != null) { stmt.bindString(17, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(18, lat); } - + String updateTime = entity.getUpdateTime(); if (updateTime != null) { stmt.bindString(19, updateTime); } - + String remark = entity.getRemark(); if (remark != null) { stmt.bindString(20, remark); } - + String underlyingPipelineType = entity.getUnderlyingPipelineType(); if (underlyingPipelineType != null) { stmt.bindString(21, underlyingPipelineType); } - + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); if (underlyingPipelineDepth != null) { stmt.bindString(22, underlyingPipelineDepth); } - + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); if (underlyingPipelineDiameter != null) { stmt.bindString(23, underlyingPipelineDiameter); } - + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); if (underlyingPipelineMaterial != null) { stmt.bindString(24, underlyingPipelineMaterial); } - + String objectType = entity.getObjectType(); if (objectType != null) { stmt.bindString(25, objectType); } - + String color = entity.getColor(); if (color != null) { stmt.bindString(26, color); } - + String imagePath = entity.getImagePath(); if (imagePath != null) { stmt.bindString(27, imagePath); @@ -244,137 +249,137 @@ @Override protected final void bindValues(SQLiteStatement stmt, MarkerLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipelineType = entity.getPipelineType(); if (pipelineType != null) { stmt.bindString(2, pipelineType); } - + String pipelineDiameter = entity.getPipelineDiameter(); if (pipelineDiameter != null) { stmt.bindString(3, pipelineDiameter); } - + String pipelineMaterial = entity.getPipelineMaterial(); if (pipelineMaterial != null) { stmt.bindString(4, pipelineMaterial); } - + String buryMethod = entity.getBuryMethod(); if (buryMethod != null) { stmt.bindString(5, buryMethod); } - + String buryDepth = entity.getBuryDepth(); if (buryDepth != null) { stmt.bindString(6, buryDepth); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(7, area); } - + String line = entity.getLine(); if (line != null) { stmt.bindString(8, line); } - + String road = entity.getRoad(); if (road != null) { stmt.bindString(9, road); } - + String constructTime = entity.getConstructTime(); if (constructTime != null) { stmt.bindString(10, constructTime); } - + String owner = entity.getOwner(); if (owner != null) { stmt.bindString(11, owner); } - + String objectId = entity.getObjectId(); if (objectId != null) { stmt.bindString(12, objectId); } - + String markerId = entity.getMarkerId(); if (markerId != null) { stmt.bindString(13, markerId); } - + String markerType = entity.getMarkerType(); if (markerType != null) { stmt.bindString(14, markerType); } - + String markerDepth = entity.getMarkerDepth(); if (markerDepth != null) { stmt.bindString(15, markerDepth); } - + String installationDept = entity.getInstallationDept(); if (installationDept != null) { stmt.bindString(16, installationDept); } - + String lng = entity.getLng(); if (lng != null) { stmt.bindString(17, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(18, lat); } - + String updateTime = entity.getUpdateTime(); if (updateTime != null) { stmt.bindString(19, updateTime); } - + String remark = entity.getRemark(); if (remark != null) { stmt.bindString(20, remark); } - + String underlyingPipelineType = entity.getUnderlyingPipelineType(); if (underlyingPipelineType != null) { stmt.bindString(21, underlyingPipelineType); } - + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); if (underlyingPipelineDepth != null) { stmt.bindString(22, underlyingPipelineDepth); } - + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); if (underlyingPipelineDiameter != null) { stmt.bindString(23, underlyingPipelineDiameter); } - + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); if (underlyingPipelineMaterial != null) { stmt.bindString(24, underlyingPipelineMaterial); } - + String objectType = entity.getObjectType(); if (objectType != null) { stmt.bindString(25, objectType); } - + String color = entity.getColor(); if (color != null) { stmt.bindString(26, color); } - + String imagePath = entity.getImagePath(); if (imagePath != null) { stmt.bindString(27, imagePath); @@ -384,42 +389,42 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MarkerLocalBean readEntity(Cursor cursor, int offset) { MarkerLocalBean entity = new MarkerLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipelineType - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineDiameter - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // buryMethod - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDepth - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // area - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // line - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // road - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // constructTime - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // owner - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // objectId - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // markerId - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // markerType - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // markerDepth - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // installationDept - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // lng - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // lat - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // updateTime - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // remark - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // underlyingPipelineType - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // underlyingPipelineDepth - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // underlyingPipelineDiameter - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // underlyingPipelineMaterial - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // objectType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // color - cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipelineType + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineDiameter + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // buryMethod + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDepth + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // area + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // line + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // road + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // constructTime + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // owner + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // objectId + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // markerId + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // markerType + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // markerDepth + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // installationDept + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // lng + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // lat + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // updateTime + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // remark + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // underlyingPipelineType + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // underlyingPipelineDepth + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // underlyingPipelineDiameter + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // underlyingPipelineMaterial + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // objectType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // color + cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath ); return entity; } - + @Override public void readEntity(Cursor cursor, MarkerLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -449,17 +454,17 @@ entity.setObjectType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setColor(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); - } - + } + @Override protected final Long updateKeyAfterInsert(MarkerLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(MarkerLocalBean entity) { - if(entity != null) { + if (entity != null) { return entity.getId(); } else { return null; @@ -475,5 +480,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/cpp/serial_port.cpp b/app/src/main/cpp/serial_port.cpp index 9daa036..6d6601f 100644 --- a/app/src/main/cpp/serial_port.cpp +++ b/app/src/main/cpp/serial_port.cpp @@ -87,7 +87,7 @@ extern "C" JNIEXPORT jobject JNICALL -Java_com_casic_detector_common_uart_SerialPortKit_open(JNIEnv *env, jobject thiz, jstring path, +Java_com_casic_detector_common_uart_JNIKit_open(JNIEnv *env, jobject thiz, jstring path, jint baud_rate, jint flags) { int fd; speed_t speed; @@ -157,7 +157,7 @@ extern "C" JNIEXPORT void JNICALL -Java_com_casic_detector_common_uart_SerialPortKit_close(JNIEnv *env, jobject thiz) { +Java_com_casic_detector_common_uart_JNIKit_close(JNIEnv *env, jobject thiz) { jclass j_fd_class = env->FindClass("java/io/FileDescriptor"); char descriptor_buffer[16] = {0}; diff --git a/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java b/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java index 27e7429..3bba972 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java @@ -13,20 +13,25 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. + /** * Master of DAO (schema version 1): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 1; - /** Creates underlying database table using DAOs. */ + /** + * Creates underlying database table using DAOs. + */ public static void createAllTables(Database db, boolean ifNotExists) { MarkerLocalBeanDao.createTable(db, ifNotExists); TaskLocalBeanDao.createTable(db, ifNotExists); TaskMarkerLocalBeanDao.createTable(db, ifNotExists); } - /** Drops underlying database table using DAOs. */ + /** + * Drops underlying database table using DAOs. + */ public static void dropAllTables(Database db, boolean ifExists) { MarkerLocalBeanDao.dropTable(db, ifExists); TaskLocalBeanDao.dropTable(db, ifExists); @@ -81,7 +86,9 @@ } } - /** WARNING: Drops all table on Upgrade! Use only during development. */ + /** + * WARNING: Drops all table on Upgrade! Use only during development. + */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java b/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java index 7fff4ea..14ecd6c 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -29,8 +29,7 @@ private final TaskLocalBeanDao taskLocalBeanDao; private final TaskMarkerLocalBeanDao taskMarkerLocalBeanDao; - public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> - daoConfigMap) { + public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); markerLocalBeanDaoConfig = daoConfigMap.get(MarkerLocalBeanDao.class).clone(); @@ -50,7 +49,7 @@ registerDao(TaskLocalBean.class, taskLocalBeanDao); registerDao(TaskMarkerLocalBean.class, taskMarkerLocalBeanDao); } - + public void clear() { markerLocalBeanDaoConfig.clearIdentityScope(); taskLocalBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java b/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java index 31de1ae..9fd362f 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java +++ b/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java @@ -12,9 +12,10 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** + +/** * DAO for table "MARKER_LOCAL_BEAN". -*/ + */ public class MarkerLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MARKER_LOCAL_BEAN"; @@ -57,14 +58,16 @@ public MarkerLocalBeanDao(DaoConfig config) { super(config); } - + public MarkerLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** Creates the underlying database table. */ + /** + * Creates the underlying database table. + */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; db.execSQL("CREATE TABLE " + constraint + "\"MARKER_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPELINE_TYPE\" TEXT," + // 1: pipelineType @@ -95,7 +98,9 @@ "\"IMAGE_PATH\" TEXT);"); // 26: imagePath } - /** Drops the underlying database table. */ + /** + * Drops the underlying database table. + */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MARKER_LOCAL_BEAN\""; db.execSQL(sql); @@ -104,137 +109,137 @@ @Override protected final void bindValues(DatabaseStatement stmt, MarkerLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipelineType = entity.getPipelineType(); if (pipelineType != null) { stmt.bindString(2, pipelineType); } - + String pipelineDiameter = entity.getPipelineDiameter(); if (pipelineDiameter != null) { stmt.bindString(3, pipelineDiameter); } - + String pipelineMaterial = entity.getPipelineMaterial(); if (pipelineMaterial != null) { stmt.bindString(4, pipelineMaterial); } - + String buryMethod = entity.getBuryMethod(); if (buryMethod != null) { stmt.bindString(5, buryMethod); } - + String buryDepth = entity.getBuryDepth(); if (buryDepth != null) { stmt.bindString(6, buryDepth); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(7, area); } - + String line = entity.getLine(); if (line != null) { stmt.bindString(8, line); } - + String road = entity.getRoad(); if (road != null) { stmt.bindString(9, road); } - + String constructTime = entity.getConstructTime(); if (constructTime != null) { stmt.bindString(10, constructTime); } - + String owner = entity.getOwner(); if (owner != null) { stmt.bindString(11, owner); } - + String objectId = entity.getObjectId(); if (objectId != null) { stmt.bindString(12, objectId); } - + String markerId = entity.getMarkerId(); if (markerId != null) { stmt.bindString(13, markerId); } - + String markerType = entity.getMarkerType(); if (markerType != null) { stmt.bindString(14, markerType); } - + String markerDepth = entity.getMarkerDepth(); if (markerDepth != null) { stmt.bindString(15, markerDepth); } - + String installationDept = entity.getInstallationDept(); if (installationDept != null) { stmt.bindString(16, installationDept); } - + String lng = entity.getLng(); if (lng != null) { stmt.bindString(17, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(18, lat); } - + String updateTime = entity.getUpdateTime(); if (updateTime != null) { stmt.bindString(19, updateTime); } - + String remark = entity.getRemark(); if (remark != null) { stmt.bindString(20, remark); } - + String underlyingPipelineType = entity.getUnderlyingPipelineType(); if (underlyingPipelineType != null) { stmt.bindString(21, underlyingPipelineType); } - + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); if (underlyingPipelineDepth != null) { stmt.bindString(22, underlyingPipelineDepth); } - + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); if (underlyingPipelineDiameter != null) { stmt.bindString(23, underlyingPipelineDiameter); } - + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); if (underlyingPipelineMaterial != null) { stmt.bindString(24, underlyingPipelineMaterial); } - + String objectType = entity.getObjectType(); if (objectType != null) { stmt.bindString(25, objectType); } - + String color = entity.getColor(); if (color != null) { stmt.bindString(26, color); } - + String imagePath = entity.getImagePath(); if (imagePath != null) { stmt.bindString(27, imagePath); @@ -244,137 +249,137 @@ @Override protected final void bindValues(SQLiteStatement stmt, MarkerLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipelineType = entity.getPipelineType(); if (pipelineType != null) { stmt.bindString(2, pipelineType); } - + String pipelineDiameter = entity.getPipelineDiameter(); if (pipelineDiameter != null) { stmt.bindString(3, pipelineDiameter); } - + String pipelineMaterial = entity.getPipelineMaterial(); if (pipelineMaterial != null) { stmt.bindString(4, pipelineMaterial); } - + String buryMethod = entity.getBuryMethod(); if (buryMethod != null) { stmt.bindString(5, buryMethod); } - + String buryDepth = entity.getBuryDepth(); if (buryDepth != null) { stmt.bindString(6, buryDepth); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(7, area); } - + String line = entity.getLine(); if (line != null) { stmt.bindString(8, line); } - + String road = entity.getRoad(); if (road != null) { stmt.bindString(9, road); } - + String constructTime = entity.getConstructTime(); if (constructTime != null) { stmt.bindString(10, constructTime); } - + String owner = entity.getOwner(); if (owner != null) { stmt.bindString(11, owner); } - + String objectId = entity.getObjectId(); if (objectId != null) { stmt.bindString(12, objectId); } - + String markerId = entity.getMarkerId(); if (markerId != null) { stmt.bindString(13, markerId); } - + String markerType = entity.getMarkerType(); if (markerType != null) { stmt.bindString(14, markerType); } - + String markerDepth = entity.getMarkerDepth(); if (markerDepth != null) { stmt.bindString(15, markerDepth); } - + String installationDept = entity.getInstallationDept(); if (installationDept != null) { stmt.bindString(16, installationDept); } - + String lng = entity.getLng(); if (lng != null) { stmt.bindString(17, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(18, lat); } - + String updateTime = entity.getUpdateTime(); if (updateTime != null) { stmt.bindString(19, updateTime); } - + String remark = entity.getRemark(); if (remark != null) { stmt.bindString(20, remark); } - + String underlyingPipelineType = entity.getUnderlyingPipelineType(); if (underlyingPipelineType != null) { stmt.bindString(21, underlyingPipelineType); } - + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); if (underlyingPipelineDepth != null) { stmt.bindString(22, underlyingPipelineDepth); } - + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); if (underlyingPipelineDiameter != null) { stmt.bindString(23, underlyingPipelineDiameter); } - + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); if (underlyingPipelineMaterial != null) { stmt.bindString(24, underlyingPipelineMaterial); } - + String objectType = entity.getObjectType(); if (objectType != null) { stmt.bindString(25, objectType); } - + String color = entity.getColor(); if (color != null) { stmt.bindString(26, color); } - + String imagePath = entity.getImagePath(); if (imagePath != null) { stmt.bindString(27, imagePath); @@ -384,42 +389,42 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MarkerLocalBean readEntity(Cursor cursor, int offset) { MarkerLocalBean entity = new MarkerLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipelineType - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineDiameter - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // buryMethod - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDepth - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // area - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // line - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // road - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // constructTime - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // owner - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // objectId - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // markerId - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // markerType - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // markerDepth - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // installationDept - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // lng - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // lat - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // updateTime - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // remark - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // underlyingPipelineType - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // underlyingPipelineDepth - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // underlyingPipelineDiameter - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // underlyingPipelineMaterial - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // objectType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // color - cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipelineType + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineDiameter + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // buryMethod + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDepth + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // area + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // line + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // road + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // constructTime + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // owner + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // objectId + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // markerId + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // markerType + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // markerDepth + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // installationDept + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // lng + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // lat + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // updateTime + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // remark + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // underlyingPipelineType + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // underlyingPipelineDepth + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // underlyingPipelineDiameter + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // underlyingPipelineMaterial + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // objectType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // color + cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath ); return entity; } - + @Override public void readEntity(Cursor cursor, MarkerLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -449,17 +454,17 @@ entity.setObjectType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setColor(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); - } - + } + @Override protected final Long updateKeyAfterInsert(MarkerLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(MarkerLocalBean entity) { - if(entity != null) { + if (entity != null) { return entity.getId(); } else { return null; @@ -475,5 +480,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/detector/common/greendao/TaskLocalBeanDao.java b/app/src/main/java/com/casic/detector/common/greendao/TaskLocalBeanDao.java index 17c6982..83543b7 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/TaskLocalBeanDao.java +++ b/app/src/main/java/com/casic/detector/common/greendao/TaskLocalBeanDao.java @@ -12,9 +12,10 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** + +/** * DAO for table "TASK_LOCAL_BEAN". -*/ + */ public class TaskLocalBeanDao extends AbstractDao { public static final String TABLENAME = "TASK_LOCAL_BEAN"; @@ -39,14 +40,16 @@ public TaskLocalBeanDao(DaoConfig config) { super(config); } - + public TaskLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** Creates the underlying database table. */ + /** + * Creates the underlying database table. + */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; db.execSQL("CREATE TABLE " + constraint + "\"TASK_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY ," + // 0: id "\"TASK_CODE\" TEXT," + // 1: taskCode @@ -59,7 +62,9 @@ "\"IS_FREE_TASK\" TEXT);"); // 8: isFreeTask } - /** Drops the underlying database table. */ + /** + * Drops the underlying database table. + */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TASK_LOCAL_BEAN\""; db.execSQL(sql); @@ -68,47 +73,47 @@ @Override protected final void bindValues(DatabaseStatement stmt, TaskLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String taskCode = entity.getTaskCode(); if (taskCode != null) { stmt.bindString(2, taskCode); } - + String description = entity.getDescription(); if (description != null) { stmt.bindString(3, description); } - + String createTime = entity.getCreateTime(); if (createTime != null) { stmt.bindString(4, createTime); } - + String status = entity.getStatus(); if (status != null) { stmt.bindString(5, status); } - + String createUserName = entity.getCreateUserName(); if (createUserName != null) { stmt.bindString(6, createUserName); } - + String startTime = entity.getStartTime(); if (startTime != null) { stmt.bindString(7, startTime); } - + String endTime = entity.getEndTime(); if (endTime != null) { stmt.bindString(8, endTime); } - + String isFreeTask = entity.getIsFreeTask(); if (isFreeTask != null) { stmt.bindString(9, isFreeTask); @@ -118,47 +123,47 @@ @Override protected final void bindValues(SQLiteStatement stmt, TaskLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String taskCode = entity.getTaskCode(); if (taskCode != null) { stmt.bindString(2, taskCode); } - + String description = entity.getDescription(); if (description != null) { stmt.bindString(3, description); } - + String createTime = entity.getCreateTime(); if (createTime != null) { stmt.bindString(4, createTime); } - + String status = entity.getStatus(); if (status != null) { stmt.bindString(5, status); } - + String createUserName = entity.getCreateUserName(); if (createUserName != null) { stmt.bindString(6, createUserName); } - + String startTime = entity.getStartTime(); if (startTime != null) { stmt.bindString(7, startTime); } - + String endTime = entity.getEndTime(); if (endTime != null) { stmt.bindString(8, endTime); } - + String isFreeTask = entity.getIsFreeTask(); if (isFreeTask != null) { stmt.bindString(9, isFreeTask); @@ -168,24 +173,24 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public TaskLocalBean readEntity(Cursor cursor, int offset) { TaskLocalBean entity = new TaskLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // taskCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // description - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // status - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // createUserName - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // startTime - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // endTime - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8) // isFreeTask + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // taskCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // description + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // status + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // createUserName + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // startTime + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // endTime + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8) // isFreeTask ); return entity; } - + @Override public void readEntity(Cursor cursor, TaskLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -197,17 +202,17 @@ entity.setStartTime(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); entity.setEndTime(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); entity.setIsFreeTask(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - } - + } + @Override protected final Long updateKeyAfterInsert(TaskLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(TaskLocalBean entity) { - if(entity != null) { + if (entity != null) { return entity.getId(); } else { return null; @@ -223,5 +228,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/cpp/serial_port.cpp b/app/src/main/cpp/serial_port.cpp index 9daa036..6d6601f 100644 --- a/app/src/main/cpp/serial_port.cpp +++ b/app/src/main/cpp/serial_port.cpp @@ -87,7 +87,7 @@ extern "C" JNIEXPORT jobject JNICALL -Java_com_casic_detector_common_uart_SerialPortKit_open(JNIEnv *env, jobject thiz, jstring path, +Java_com_casic_detector_common_uart_JNIKit_open(JNIEnv *env, jobject thiz, jstring path, jint baud_rate, jint flags) { int fd; speed_t speed; @@ -157,7 +157,7 @@ extern "C" JNIEXPORT void JNICALL -Java_com_casic_detector_common_uart_SerialPortKit_close(JNIEnv *env, jobject thiz) { +Java_com_casic_detector_common_uart_JNIKit_close(JNIEnv *env, jobject thiz) { jclass j_fd_class = env->FindClass("java/io/FileDescriptor"); char descriptor_buffer[16] = {0}; diff --git a/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java b/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java index 27e7429..3bba972 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java @@ -13,20 +13,25 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. + /** * Master of DAO (schema version 1): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 1; - /** Creates underlying database table using DAOs. */ + /** + * Creates underlying database table using DAOs. + */ public static void createAllTables(Database db, boolean ifNotExists) { MarkerLocalBeanDao.createTable(db, ifNotExists); TaskLocalBeanDao.createTable(db, ifNotExists); TaskMarkerLocalBeanDao.createTable(db, ifNotExists); } - /** Drops underlying database table using DAOs. */ + /** + * Drops underlying database table using DAOs. + */ public static void dropAllTables(Database db, boolean ifExists) { MarkerLocalBeanDao.dropTable(db, ifExists); TaskLocalBeanDao.dropTable(db, ifExists); @@ -81,7 +86,9 @@ } } - /** WARNING: Drops all table on Upgrade! Use only during development. */ + /** + * WARNING: Drops all table on Upgrade! Use only during development. + */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java b/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java index 7fff4ea..14ecd6c 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -29,8 +29,7 @@ private final TaskLocalBeanDao taskLocalBeanDao; private final TaskMarkerLocalBeanDao taskMarkerLocalBeanDao; - public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> - daoConfigMap) { + public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); markerLocalBeanDaoConfig = daoConfigMap.get(MarkerLocalBeanDao.class).clone(); @@ -50,7 +49,7 @@ registerDao(TaskLocalBean.class, taskLocalBeanDao); registerDao(TaskMarkerLocalBean.class, taskMarkerLocalBeanDao); } - + public void clear() { markerLocalBeanDaoConfig.clearIdentityScope(); taskLocalBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java b/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java index 31de1ae..9fd362f 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java +++ b/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java @@ -12,9 +12,10 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** + +/** * DAO for table "MARKER_LOCAL_BEAN". -*/ + */ public class MarkerLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MARKER_LOCAL_BEAN"; @@ -57,14 +58,16 @@ public MarkerLocalBeanDao(DaoConfig config) { super(config); } - + public MarkerLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** Creates the underlying database table. */ + /** + * Creates the underlying database table. + */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; db.execSQL("CREATE TABLE " + constraint + "\"MARKER_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPELINE_TYPE\" TEXT," + // 1: pipelineType @@ -95,7 +98,9 @@ "\"IMAGE_PATH\" TEXT);"); // 26: imagePath } - /** Drops the underlying database table. */ + /** + * Drops the underlying database table. + */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MARKER_LOCAL_BEAN\""; db.execSQL(sql); @@ -104,137 +109,137 @@ @Override protected final void bindValues(DatabaseStatement stmt, MarkerLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipelineType = entity.getPipelineType(); if (pipelineType != null) { stmt.bindString(2, pipelineType); } - + String pipelineDiameter = entity.getPipelineDiameter(); if (pipelineDiameter != null) { stmt.bindString(3, pipelineDiameter); } - + String pipelineMaterial = entity.getPipelineMaterial(); if (pipelineMaterial != null) { stmt.bindString(4, pipelineMaterial); } - + String buryMethod = entity.getBuryMethod(); if (buryMethod != null) { stmt.bindString(5, buryMethod); } - + String buryDepth = entity.getBuryDepth(); if (buryDepth != null) { stmt.bindString(6, buryDepth); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(7, area); } - + String line = entity.getLine(); if (line != null) { stmt.bindString(8, line); } - + String road = entity.getRoad(); if (road != null) { stmt.bindString(9, road); } - + String constructTime = entity.getConstructTime(); if (constructTime != null) { stmt.bindString(10, constructTime); } - + String owner = entity.getOwner(); if (owner != null) { stmt.bindString(11, owner); } - + String objectId = entity.getObjectId(); if (objectId != null) { stmt.bindString(12, objectId); } - + String markerId = entity.getMarkerId(); if (markerId != null) { stmt.bindString(13, markerId); } - + String markerType = entity.getMarkerType(); if (markerType != null) { stmt.bindString(14, markerType); } - + String markerDepth = entity.getMarkerDepth(); if (markerDepth != null) { stmt.bindString(15, markerDepth); } - + String installationDept = entity.getInstallationDept(); if (installationDept != null) { stmt.bindString(16, installationDept); } - + String lng = entity.getLng(); if (lng != null) { stmt.bindString(17, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(18, lat); } - + String updateTime = entity.getUpdateTime(); if (updateTime != null) { stmt.bindString(19, updateTime); } - + String remark = entity.getRemark(); if (remark != null) { stmt.bindString(20, remark); } - + String underlyingPipelineType = entity.getUnderlyingPipelineType(); if (underlyingPipelineType != null) { stmt.bindString(21, underlyingPipelineType); } - + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); if (underlyingPipelineDepth != null) { stmt.bindString(22, underlyingPipelineDepth); } - + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); if (underlyingPipelineDiameter != null) { stmt.bindString(23, underlyingPipelineDiameter); } - + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); if (underlyingPipelineMaterial != null) { stmt.bindString(24, underlyingPipelineMaterial); } - + String objectType = entity.getObjectType(); if (objectType != null) { stmt.bindString(25, objectType); } - + String color = entity.getColor(); if (color != null) { stmt.bindString(26, color); } - + String imagePath = entity.getImagePath(); if (imagePath != null) { stmt.bindString(27, imagePath); @@ -244,137 +249,137 @@ @Override protected final void bindValues(SQLiteStatement stmt, MarkerLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipelineType = entity.getPipelineType(); if (pipelineType != null) { stmt.bindString(2, pipelineType); } - + String pipelineDiameter = entity.getPipelineDiameter(); if (pipelineDiameter != null) { stmt.bindString(3, pipelineDiameter); } - + String pipelineMaterial = entity.getPipelineMaterial(); if (pipelineMaterial != null) { stmt.bindString(4, pipelineMaterial); } - + String buryMethod = entity.getBuryMethod(); if (buryMethod != null) { stmt.bindString(5, buryMethod); } - + String buryDepth = entity.getBuryDepth(); if (buryDepth != null) { stmt.bindString(6, buryDepth); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(7, area); } - + String line = entity.getLine(); if (line != null) { stmt.bindString(8, line); } - + String road = entity.getRoad(); if (road != null) { stmt.bindString(9, road); } - + String constructTime = entity.getConstructTime(); if (constructTime != null) { stmt.bindString(10, constructTime); } - + String owner = entity.getOwner(); if (owner != null) { stmt.bindString(11, owner); } - + String objectId = entity.getObjectId(); if (objectId != null) { stmt.bindString(12, objectId); } - + String markerId = entity.getMarkerId(); if (markerId != null) { stmt.bindString(13, markerId); } - + String markerType = entity.getMarkerType(); if (markerType != null) { stmt.bindString(14, markerType); } - + String markerDepth = entity.getMarkerDepth(); if (markerDepth != null) { stmt.bindString(15, markerDepth); } - + String installationDept = entity.getInstallationDept(); if (installationDept != null) { stmt.bindString(16, installationDept); } - + String lng = entity.getLng(); if (lng != null) { stmt.bindString(17, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(18, lat); } - + String updateTime = entity.getUpdateTime(); if (updateTime != null) { stmt.bindString(19, updateTime); } - + String remark = entity.getRemark(); if (remark != null) { stmt.bindString(20, remark); } - + String underlyingPipelineType = entity.getUnderlyingPipelineType(); if (underlyingPipelineType != null) { stmt.bindString(21, underlyingPipelineType); } - + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); if (underlyingPipelineDepth != null) { stmt.bindString(22, underlyingPipelineDepth); } - + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); if (underlyingPipelineDiameter != null) { stmt.bindString(23, underlyingPipelineDiameter); } - + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); if (underlyingPipelineMaterial != null) { stmt.bindString(24, underlyingPipelineMaterial); } - + String objectType = entity.getObjectType(); if (objectType != null) { stmt.bindString(25, objectType); } - + String color = entity.getColor(); if (color != null) { stmt.bindString(26, color); } - + String imagePath = entity.getImagePath(); if (imagePath != null) { stmt.bindString(27, imagePath); @@ -384,42 +389,42 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MarkerLocalBean readEntity(Cursor cursor, int offset) { MarkerLocalBean entity = new MarkerLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipelineType - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineDiameter - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // buryMethod - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDepth - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // area - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // line - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // road - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // constructTime - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // owner - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // objectId - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // markerId - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // markerType - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // markerDepth - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // installationDept - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // lng - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // lat - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // updateTime - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // remark - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // underlyingPipelineType - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // underlyingPipelineDepth - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // underlyingPipelineDiameter - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // underlyingPipelineMaterial - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // objectType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // color - cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipelineType + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineDiameter + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // buryMethod + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDepth + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // area + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // line + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // road + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // constructTime + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // owner + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // objectId + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // markerId + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // markerType + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // markerDepth + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // installationDept + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // lng + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // lat + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // updateTime + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // remark + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // underlyingPipelineType + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // underlyingPipelineDepth + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // underlyingPipelineDiameter + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // underlyingPipelineMaterial + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // objectType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // color + cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath ); return entity; } - + @Override public void readEntity(Cursor cursor, MarkerLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -449,17 +454,17 @@ entity.setObjectType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setColor(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); - } - + } + @Override protected final Long updateKeyAfterInsert(MarkerLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(MarkerLocalBean entity) { - if(entity != null) { + if (entity != null) { return entity.getId(); } else { return null; @@ -475,5 +480,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/detector/common/greendao/TaskLocalBeanDao.java b/app/src/main/java/com/casic/detector/common/greendao/TaskLocalBeanDao.java index 17c6982..83543b7 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/TaskLocalBeanDao.java +++ b/app/src/main/java/com/casic/detector/common/greendao/TaskLocalBeanDao.java @@ -12,9 +12,10 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** + +/** * DAO for table "TASK_LOCAL_BEAN". -*/ + */ public class TaskLocalBeanDao extends AbstractDao { public static final String TABLENAME = "TASK_LOCAL_BEAN"; @@ -39,14 +40,16 @@ public TaskLocalBeanDao(DaoConfig config) { super(config); } - + public TaskLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** Creates the underlying database table. */ + /** + * Creates the underlying database table. + */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; db.execSQL("CREATE TABLE " + constraint + "\"TASK_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY ," + // 0: id "\"TASK_CODE\" TEXT," + // 1: taskCode @@ -59,7 +62,9 @@ "\"IS_FREE_TASK\" TEXT);"); // 8: isFreeTask } - /** Drops the underlying database table. */ + /** + * Drops the underlying database table. + */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TASK_LOCAL_BEAN\""; db.execSQL(sql); @@ -68,47 +73,47 @@ @Override protected final void bindValues(DatabaseStatement stmt, TaskLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String taskCode = entity.getTaskCode(); if (taskCode != null) { stmt.bindString(2, taskCode); } - + String description = entity.getDescription(); if (description != null) { stmt.bindString(3, description); } - + String createTime = entity.getCreateTime(); if (createTime != null) { stmt.bindString(4, createTime); } - + String status = entity.getStatus(); if (status != null) { stmt.bindString(5, status); } - + String createUserName = entity.getCreateUserName(); if (createUserName != null) { stmt.bindString(6, createUserName); } - + String startTime = entity.getStartTime(); if (startTime != null) { stmt.bindString(7, startTime); } - + String endTime = entity.getEndTime(); if (endTime != null) { stmt.bindString(8, endTime); } - + String isFreeTask = entity.getIsFreeTask(); if (isFreeTask != null) { stmt.bindString(9, isFreeTask); @@ -118,47 +123,47 @@ @Override protected final void bindValues(SQLiteStatement stmt, TaskLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String taskCode = entity.getTaskCode(); if (taskCode != null) { stmt.bindString(2, taskCode); } - + String description = entity.getDescription(); if (description != null) { stmt.bindString(3, description); } - + String createTime = entity.getCreateTime(); if (createTime != null) { stmt.bindString(4, createTime); } - + String status = entity.getStatus(); if (status != null) { stmt.bindString(5, status); } - + String createUserName = entity.getCreateUserName(); if (createUserName != null) { stmt.bindString(6, createUserName); } - + String startTime = entity.getStartTime(); if (startTime != null) { stmt.bindString(7, startTime); } - + String endTime = entity.getEndTime(); if (endTime != null) { stmt.bindString(8, endTime); } - + String isFreeTask = entity.getIsFreeTask(); if (isFreeTask != null) { stmt.bindString(9, isFreeTask); @@ -168,24 +173,24 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public TaskLocalBean readEntity(Cursor cursor, int offset) { TaskLocalBean entity = new TaskLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // taskCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // description - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // status - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // createUserName - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // startTime - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // endTime - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8) // isFreeTask + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // taskCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // description + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // status + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // createUserName + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // startTime + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // endTime + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8) // isFreeTask ); return entity; } - + @Override public void readEntity(Cursor cursor, TaskLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -197,17 +202,17 @@ entity.setStartTime(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); entity.setEndTime(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); entity.setIsFreeTask(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - } - + } + @Override protected final Long updateKeyAfterInsert(TaskLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(TaskLocalBean entity) { - if(entity != null) { + if (entity != null) { return entity.getId(); } else { return null; @@ -223,5 +228,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/detector/common/greendao/TaskMarkerLocalBeanDao.java b/app/src/main/java/com/casic/detector/common/greendao/TaskMarkerLocalBeanDao.java index b2e38af..5870ce4 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/TaskMarkerLocalBeanDao.java +++ b/app/src/main/java/com/casic/detector/common/greendao/TaskMarkerLocalBeanDao.java @@ -12,9 +12,10 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** + +/** * DAO for table "TASK_MARKER_LOCAL_BEAN". -*/ + */ public class TaskMarkerLocalBeanDao extends AbstractDao { public static final String TABLENAME = "TASK_MARKER_LOCAL_BEAN"; @@ -38,14 +39,16 @@ public TaskMarkerLocalBeanDao(DaoConfig config) { super(config); } - + public TaskMarkerLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** Creates the underlying database table. */ + /** + * Creates the underlying database table. + */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; db.execSQL("CREATE TABLE " + constraint + "\"TASK_MARKER_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY ," + // 0: id "\"TASK_ID\" TEXT," + // 1: taskId @@ -57,7 +60,9 @@ "\"DETECTED_TIME\" TEXT);"); // 7: detectedTime } - /** Drops the underlying database table. */ + /** + * Drops the underlying database table. + */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TASK_MARKER_LOCAL_BEAN\""; db.execSQL(sql); @@ -66,34 +71,34 @@ @Override protected final void bindValues(DatabaseStatement stmt, TaskMarkerLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(2, taskId); } - + String taskCode = entity.getTaskCode(); if (taskCode != null) { stmt.bindString(3, taskCode); } - + String markerId = entity.getMarkerId(); if (markerId != null) { stmt.bindString(4, markerId); } stmt.bindDouble(5, entity.getLng()); stmt.bindDouble(6, entity.getLat()); - + String isDetected = entity.getIsDetected(); if (isDetected != null) { stmt.bindString(7, isDetected); } - + String detectedTime = entity.getDetectedTime(); if (detectedTime != null) { stmt.bindString(8, detectedTime); @@ -103,34 +108,34 @@ @Override protected final void bindValues(SQLiteStatement stmt, TaskMarkerLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(2, taskId); } - + String taskCode = entity.getTaskCode(); if (taskCode != null) { stmt.bindString(3, taskCode); } - + String markerId = entity.getMarkerId(); if (markerId != null) { stmt.bindString(4, markerId); } stmt.bindDouble(5, entity.getLng()); stmt.bindDouble(6, entity.getLat()); - + String isDetected = entity.getIsDetected(); if (isDetected != null) { stmt.bindString(7, isDetected); } - + String detectedTime = entity.getDetectedTime(); if (detectedTime != null) { stmt.bindString(8, detectedTime); @@ -140,23 +145,23 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public TaskMarkerLocalBean readEntity(Cursor cursor, int offset) { TaskMarkerLocalBean entity = new TaskMarkerLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // taskId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // taskCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // markerId - cursor.getDouble(offset + 4), // lng - cursor.getDouble(offset + 5), // lat - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // isDetected - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // detectedTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // taskId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // taskCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // markerId + cursor.getDouble(offset + 4), // lng + cursor.getDouble(offset + 5), // lat + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // isDetected + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // detectedTime ); return entity; } - + @Override public void readEntity(Cursor cursor, TaskMarkerLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -167,17 +172,17 @@ entity.setLat(cursor.getDouble(offset + 5)); entity.setIsDetected(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); entity.setDetectedTime(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - + } + @Override protected final Long updateKeyAfterInsert(TaskMarkerLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(TaskMarkerLocalBean entity) { - if(entity != null) { + if (entity != null) { return entity.getId(); } else { return null; @@ -193,5 +198,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/cpp/serial_port.cpp b/app/src/main/cpp/serial_port.cpp index 9daa036..6d6601f 100644 --- a/app/src/main/cpp/serial_port.cpp +++ b/app/src/main/cpp/serial_port.cpp @@ -87,7 +87,7 @@ extern "C" JNIEXPORT jobject JNICALL -Java_com_casic_detector_common_uart_SerialPortKit_open(JNIEnv *env, jobject thiz, jstring path, +Java_com_casic_detector_common_uart_JNIKit_open(JNIEnv *env, jobject thiz, jstring path, jint baud_rate, jint flags) { int fd; speed_t speed; @@ -157,7 +157,7 @@ extern "C" JNIEXPORT void JNICALL -Java_com_casic_detector_common_uart_SerialPortKit_close(JNIEnv *env, jobject thiz) { +Java_com_casic_detector_common_uart_JNIKit_close(JNIEnv *env, jobject thiz) { jclass j_fd_class = env->FindClass("java/io/FileDescriptor"); char descriptor_buffer[16] = {0}; diff --git a/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java b/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java index 27e7429..3bba972 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java @@ -13,20 +13,25 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. + /** * Master of DAO (schema version 1): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 1; - /** Creates underlying database table using DAOs. */ + /** + * Creates underlying database table using DAOs. + */ public static void createAllTables(Database db, boolean ifNotExists) { MarkerLocalBeanDao.createTable(db, ifNotExists); TaskLocalBeanDao.createTable(db, ifNotExists); TaskMarkerLocalBeanDao.createTable(db, ifNotExists); } - /** Drops underlying database table using DAOs. */ + /** + * Drops underlying database table using DAOs. + */ public static void dropAllTables(Database db, boolean ifExists) { MarkerLocalBeanDao.dropTable(db, ifExists); TaskLocalBeanDao.dropTable(db, ifExists); @@ -81,7 +86,9 @@ } } - /** WARNING: Drops all table on Upgrade! Use only during development. */ + /** + * WARNING: Drops all table on Upgrade! Use only during development. + */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java b/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java index 7fff4ea..14ecd6c 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -29,8 +29,7 @@ private final TaskLocalBeanDao taskLocalBeanDao; private final TaskMarkerLocalBeanDao taskMarkerLocalBeanDao; - public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> - daoConfigMap) { + public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); markerLocalBeanDaoConfig = daoConfigMap.get(MarkerLocalBeanDao.class).clone(); @@ -50,7 +49,7 @@ registerDao(TaskLocalBean.class, taskLocalBeanDao); registerDao(TaskMarkerLocalBean.class, taskMarkerLocalBeanDao); } - + public void clear() { markerLocalBeanDaoConfig.clearIdentityScope(); taskLocalBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java b/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java index 31de1ae..9fd362f 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java +++ b/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java @@ -12,9 +12,10 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** + +/** * DAO for table "MARKER_LOCAL_BEAN". -*/ + */ public class MarkerLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MARKER_LOCAL_BEAN"; @@ -57,14 +58,16 @@ public MarkerLocalBeanDao(DaoConfig config) { super(config); } - + public MarkerLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** Creates the underlying database table. */ + /** + * Creates the underlying database table. + */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; db.execSQL("CREATE TABLE " + constraint + "\"MARKER_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPELINE_TYPE\" TEXT," + // 1: pipelineType @@ -95,7 +98,9 @@ "\"IMAGE_PATH\" TEXT);"); // 26: imagePath } - /** Drops the underlying database table. */ + /** + * Drops the underlying database table. + */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MARKER_LOCAL_BEAN\""; db.execSQL(sql); @@ -104,137 +109,137 @@ @Override protected final void bindValues(DatabaseStatement stmt, MarkerLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipelineType = entity.getPipelineType(); if (pipelineType != null) { stmt.bindString(2, pipelineType); } - + String pipelineDiameter = entity.getPipelineDiameter(); if (pipelineDiameter != null) { stmt.bindString(3, pipelineDiameter); } - + String pipelineMaterial = entity.getPipelineMaterial(); if (pipelineMaterial != null) { stmt.bindString(4, pipelineMaterial); } - + String buryMethod = entity.getBuryMethod(); if (buryMethod != null) { stmt.bindString(5, buryMethod); } - + String buryDepth = entity.getBuryDepth(); if (buryDepth != null) { stmt.bindString(6, buryDepth); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(7, area); } - + String line = entity.getLine(); if (line != null) { stmt.bindString(8, line); } - + String road = entity.getRoad(); if (road != null) { stmt.bindString(9, road); } - + String constructTime = entity.getConstructTime(); if (constructTime != null) { stmt.bindString(10, constructTime); } - + String owner = entity.getOwner(); if (owner != null) { stmt.bindString(11, owner); } - + String objectId = entity.getObjectId(); if (objectId != null) { stmt.bindString(12, objectId); } - + String markerId = entity.getMarkerId(); if (markerId != null) { stmt.bindString(13, markerId); } - + String markerType = entity.getMarkerType(); if (markerType != null) { stmt.bindString(14, markerType); } - + String markerDepth = entity.getMarkerDepth(); if (markerDepth != null) { stmt.bindString(15, markerDepth); } - + String installationDept = entity.getInstallationDept(); if (installationDept != null) { stmt.bindString(16, installationDept); } - + String lng = entity.getLng(); if (lng != null) { stmt.bindString(17, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(18, lat); } - + String updateTime = entity.getUpdateTime(); if (updateTime != null) { stmt.bindString(19, updateTime); } - + String remark = entity.getRemark(); if (remark != null) { stmt.bindString(20, remark); } - + String underlyingPipelineType = entity.getUnderlyingPipelineType(); if (underlyingPipelineType != null) { stmt.bindString(21, underlyingPipelineType); } - + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); if (underlyingPipelineDepth != null) { stmt.bindString(22, underlyingPipelineDepth); } - + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); if (underlyingPipelineDiameter != null) { stmt.bindString(23, underlyingPipelineDiameter); } - + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); if (underlyingPipelineMaterial != null) { stmt.bindString(24, underlyingPipelineMaterial); } - + String objectType = entity.getObjectType(); if (objectType != null) { stmt.bindString(25, objectType); } - + String color = entity.getColor(); if (color != null) { stmt.bindString(26, color); } - + String imagePath = entity.getImagePath(); if (imagePath != null) { stmt.bindString(27, imagePath); @@ -244,137 +249,137 @@ @Override protected final void bindValues(SQLiteStatement stmt, MarkerLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipelineType = entity.getPipelineType(); if (pipelineType != null) { stmt.bindString(2, pipelineType); } - + String pipelineDiameter = entity.getPipelineDiameter(); if (pipelineDiameter != null) { stmt.bindString(3, pipelineDiameter); } - + String pipelineMaterial = entity.getPipelineMaterial(); if (pipelineMaterial != null) { stmt.bindString(4, pipelineMaterial); } - + String buryMethod = entity.getBuryMethod(); if (buryMethod != null) { stmt.bindString(5, buryMethod); } - + String buryDepth = entity.getBuryDepth(); if (buryDepth != null) { stmt.bindString(6, buryDepth); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(7, area); } - + String line = entity.getLine(); if (line != null) { stmt.bindString(8, line); } - + String road = entity.getRoad(); if (road != null) { stmt.bindString(9, road); } - + String constructTime = entity.getConstructTime(); if (constructTime != null) { stmt.bindString(10, constructTime); } - + String owner = entity.getOwner(); if (owner != null) { stmt.bindString(11, owner); } - + String objectId = entity.getObjectId(); if (objectId != null) { stmt.bindString(12, objectId); } - + String markerId = entity.getMarkerId(); if (markerId != null) { stmt.bindString(13, markerId); } - + String markerType = entity.getMarkerType(); if (markerType != null) { stmt.bindString(14, markerType); } - + String markerDepth = entity.getMarkerDepth(); if (markerDepth != null) { stmt.bindString(15, markerDepth); } - + String installationDept = entity.getInstallationDept(); if (installationDept != null) { stmt.bindString(16, installationDept); } - + String lng = entity.getLng(); if (lng != null) { stmt.bindString(17, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(18, lat); } - + String updateTime = entity.getUpdateTime(); if (updateTime != null) { stmt.bindString(19, updateTime); } - + String remark = entity.getRemark(); if (remark != null) { stmt.bindString(20, remark); } - + String underlyingPipelineType = entity.getUnderlyingPipelineType(); if (underlyingPipelineType != null) { stmt.bindString(21, underlyingPipelineType); } - + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); if (underlyingPipelineDepth != null) { stmt.bindString(22, underlyingPipelineDepth); } - + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); if (underlyingPipelineDiameter != null) { stmt.bindString(23, underlyingPipelineDiameter); } - + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); if (underlyingPipelineMaterial != null) { stmt.bindString(24, underlyingPipelineMaterial); } - + String objectType = entity.getObjectType(); if (objectType != null) { stmt.bindString(25, objectType); } - + String color = entity.getColor(); if (color != null) { stmt.bindString(26, color); } - + String imagePath = entity.getImagePath(); if (imagePath != null) { stmt.bindString(27, imagePath); @@ -384,42 +389,42 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MarkerLocalBean readEntity(Cursor cursor, int offset) { MarkerLocalBean entity = new MarkerLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipelineType - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineDiameter - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // buryMethod - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDepth - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // area - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // line - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // road - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // constructTime - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // owner - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // objectId - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // markerId - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // markerType - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // markerDepth - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // installationDept - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // lng - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // lat - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // updateTime - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // remark - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // underlyingPipelineType - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // underlyingPipelineDepth - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // underlyingPipelineDiameter - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // underlyingPipelineMaterial - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // objectType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // color - cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipelineType + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineDiameter + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // buryMethod + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDepth + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // area + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // line + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // road + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // constructTime + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // owner + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // objectId + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // markerId + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // markerType + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // markerDepth + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // installationDept + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // lng + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // lat + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // updateTime + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // remark + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // underlyingPipelineType + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // underlyingPipelineDepth + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // underlyingPipelineDiameter + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // underlyingPipelineMaterial + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // objectType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // color + cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath ); return entity; } - + @Override public void readEntity(Cursor cursor, MarkerLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -449,17 +454,17 @@ entity.setObjectType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setColor(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); - } - + } + @Override protected final Long updateKeyAfterInsert(MarkerLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(MarkerLocalBean entity) { - if(entity != null) { + if (entity != null) { return entity.getId(); } else { return null; @@ -475,5 +480,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/detector/common/greendao/TaskLocalBeanDao.java b/app/src/main/java/com/casic/detector/common/greendao/TaskLocalBeanDao.java index 17c6982..83543b7 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/TaskLocalBeanDao.java +++ b/app/src/main/java/com/casic/detector/common/greendao/TaskLocalBeanDao.java @@ -12,9 +12,10 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** + +/** * DAO for table "TASK_LOCAL_BEAN". -*/ + */ public class TaskLocalBeanDao extends AbstractDao { public static final String TABLENAME = "TASK_LOCAL_BEAN"; @@ -39,14 +40,16 @@ public TaskLocalBeanDao(DaoConfig config) { super(config); } - + public TaskLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** Creates the underlying database table. */ + /** + * Creates the underlying database table. + */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; db.execSQL("CREATE TABLE " + constraint + "\"TASK_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY ," + // 0: id "\"TASK_CODE\" TEXT," + // 1: taskCode @@ -59,7 +62,9 @@ "\"IS_FREE_TASK\" TEXT);"); // 8: isFreeTask } - /** Drops the underlying database table. */ + /** + * Drops the underlying database table. + */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TASK_LOCAL_BEAN\""; db.execSQL(sql); @@ -68,47 +73,47 @@ @Override protected final void bindValues(DatabaseStatement stmt, TaskLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String taskCode = entity.getTaskCode(); if (taskCode != null) { stmt.bindString(2, taskCode); } - + String description = entity.getDescription(); if (description != null) { stmt.bindString(3, description); } - + String createTime = entity.getCreateTime(); if (createTime != null) { stmt.bindString(4, createTime); } - + String status = entity.getStatus(); if (status != null) { stmt.bindString(5, status); } - + String createUserName = entity.getCreateUserName(); if (createUserName != null) { stmt.bindString(6, createUserName); } - + String startTime = entity.getStartTime(); if (startTime != null) { stmt.bindString(7, startTime); } - + String endTime = entity.getEndTime(); if (endTime != null) { stmt.bindString(8, endTime); } - + String isFreeTask = entity.getIsFreeTask(); if (isFreeTask != null) { stmt.bindString(9, isFreeTask); @@ -118,47 +123,47 @@ @Override protected final void bindValues(SQLiteStatement stmt, TaskLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String taskCode = entity.getTaskCode(); if (taskCode != null) { stmt.bindString(2, taskCode); } - + String description = entity.getDescription(); if (description != null) { stmt.bindString(3, description); } - + String createTime = entity.getCreateTime(); if (createTime != null) { stmt.bindString(4, createTime); } - + String status = entity.getStatus(); if (status != null) { stmt.bindString(5, status); } - + String createUserName = entity.getCreateUserName(); if (createUserName != null) { stmt.bindString(6, createUserName); } - + String startTime = entity.getStartTime(); if (startTime != null) { stmt.bindString(7, startTime); } - + String endTime = entity.getEndTime(); if (endTime != null) { stmt.bindString(8, endTime); } - + String isFreeTask = entity.getIsFreeTask(); if (isFreeTask != null) { stmt.bindString(9, isFreeTask); @@ -168,24 +173,24 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public TaskLocalBean readEntity(Cursor cursor, int offset) { TaskLocalBean entity = new TaskLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // taskCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // description - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // status - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // createUserName - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // startTime - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // endTime - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8) // isFreeTask + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // taskCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // description + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // status + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // createUserName + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // startTime + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // endTime + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8) // isFreeTask ); return entity; } - + @Override public void readEntity(Cursor cursor, TaskLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -197,17 +202,17 @@ entity.setStartTime(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); entity.setEndTime(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); entity.setIsFreeTask(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - } - + } + @Override protected final Long updateKeyAfterInsert(TaskLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(TaskLocalBean entity) { - if(entity != null) { + if (entity != null) { return entity.getId(); } else { return null; @@ -223,5 +228,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/detector/common/greendao/TaskMarkerLocalBeanDao.java b/app/src/main/java/com/casic/detector/common/greendao/TaskMarkerLocalBeanDao.java index b2e38af..5870ce4 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/TaskMarkerLocalBeanDao.java +++ b/app/src/main/java/com/casic/detector/common/greendao/TaskMarkerLocalBeanDao.java @@ -12,9 +12,10 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** + +/** * DAO for table "TASK_MARKER_LOCAL_BEAN". -*/ + */ public class TaskMarkerLocalBeanDao extends AbstractDao { public static final String TABLENAME = "TASK_MARKER_LOCAL_BEAN"; @@ -38,14 +39,16 @@ public TaskMarkerLocalBeanDao(DaoConfig config) { super(config); } - + public TaskMarkerLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** Creates the underlying database table. */ + /** + * Creates the underlying database table. + */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; db.execSQL("CREATE TABLE " + constraint + "\"TASK_MARKER_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY ," + // 0: id "\"TASK_ID\" TEXT," + // 1: taskId @@ -57,7 +60,9 @@ "\"DETECTED_TIME\" TEXT);"); // 7: detectedTime } - /** Drops the underlying database table. */ + /** + * Drops the underlying database table. + */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TASK_MARKER_LOCAL_BEAN\""; db.execSQL(sql); @@ -66,34 +71,34 @@ @Override protected final void bindValues(DatabaseStatement stmt, TaskMarkerLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(2, taskId); } - + String taskCode = entity.getTaskCode(); if (taskCode != null) { stmt.bindString(3, taskCode); } - + String markerId = entity.getMarkerId(); if (markerId != null) { stmt.bindString(4, markerId); } stmt.bindDouble(5, entity.getLng()); stmt.bindDouble(6, entity.getLat()); - + String isDetected = entity.getIsDetected(); if (isDetected != null) { stmt.bindString(7, isDetected); } - + String detectedTime = entity.getDetectedTime(); if (detectedTime != null) { stmt.bindString(8, detectedTime); @@ -103,34 +108,34 @@ @Override protected final void bindValues(SQLiteStatement stmt, TaskMarkerLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(2, taskId); } - + String taskCode = entity.getTaskCode(); if (taskCode != null) { stmt.bindString(3, taskCode); } - + String markerId = entity.getMarkerId(); if (markerId != null) { stmt.bindString(4, markerId); } stmt.bindDouble(5, entity.getLng()); stmt.bindDouble(6, entity.getLat()); - + String isDetected = entity.getIsDetected(); if (isDetected != null) { stmt.bindString(7, isDetected); } - + String detectedTime = entity.getDetectedTime(); if (detectedTime != null) { stmt.bindString(8, detectedTime); @@ -140,23 +145,23 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public TaskMarkerLocalBean readEntity(Cursor cursor, int offset) { TaskMarkerLocalBean entity = new TaskMarkerLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // taskId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // taskCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // markerId - cursor.getDouble(offset + 4), // lng - cursor.getDouble(offset + 5), // lat - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // isDetected - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // detectedTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // taskId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // taskCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // markerId + cursor.getDouble(offset + 4), // lng + cursor.getDouble(offset + 5), // lat + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // isDetected + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // detectedTime ); return entity; } - + @Override public void readEntity(Cursor cursor, TaskMarkerLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -167,17 +172,17 @@ entity.setLat(cursor.getDouble(offset + 5)); entity.setIsDetected(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); entity.setDetectedTime(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - + } + @Override protected final Long updateKeyAfterInsert(TaskMarkerLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(TaskMarkerLocalBean entity) { - if(entity != null) { + if (entity != null) { return entity.getId(); } else { return null; @@ -193,5 +198,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/detector/common/uart/JNIKit.java b/app/src/main/java/com/casic/detector/common/uart/JNIKit.java new file mode 100644 index 0000000..24b163f --- /dev/null +++ b/app/src/main/java/com/casic/detector/common/uart/JNIKit.java @@ -0,0 +1,13 @@ +package com.casic.detector.common.uart; + +import java.io.FileDescriptor; + +public class JNIKit { + static { + System.loadLibrary("serial_port"); + } + + public native FileDescriptor open(String path, int baudRate, int flags); + + public native void close(); +} diff --git a/app/src/main/cpp/serial_port.cpp b/app/src/main/cpp/serial_port.cpp index 9daa036..6d6601f 100644 --- a/app/src/main/cpp/serial_port.cpp +++ b/app/src/main/cpp/serial_port.cpp @@ -87,7 +87,7 @@ extern "C" JNIEXPORT jobject JNICALL -Java_com_casic_detector_common_uart_SerialPortKit_open(JNIEnv *env, jobject thiz, jstring path, +Java_com_casic_detector_common_uart_JNIKit_open(JNIEnv *env, jobject thiz, jstring path, jint baud_rate, jint flags) { int fd; speed_t speed; @@ -157,7 +157,7 @@ extern "C" JNIEXPORT void JNICALL -Java_com_casic_detector_common_uart_SerialPortKit_close(JNIEnv *env, jobject thiz) { +Java_com_casic_detector_common_uart_JNIKit_close(JNIEnv *env, jobject thiz) { jclass j_fd_class = env->FindClass("java/io/FileDescriptor"); char descriptor_buffer[16] = {0}; diff --git a/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java b/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java index 27e7429..3bba972 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java @@ -13,20 +13,25 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. + /** * Master of DAO (schema version 1): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 1; - /** Creates underlying database table using DAOs. */ + /** + * Creates underlying database table using DAOs. + */ public static void createAllTables(Database db, boolean ifNotExists) { MarkerLocalBeanDao.createTable(db, ifNotExists); TaskLocalBeanDao.createTable(db, ifNotExists); TaskMarkerLocalBeanDao.createTable(db, ifNotExists); } - /** Drops underlying database table using DAOs. */ + /** + * Drops underlying database table using DAOs. + */ public static void dropAllTables(Database db, boolean ifExists) { MarkerLocalBeanDao.dropTable(db, ifExists); TaskLocalBeanDao.dropTable(db, ifExists); @@ -81,7 +86,9 @@ } } - /** WARNING: Drops all table on Upgrade! Use only during development. */ + /** + * WARNING: Drops all table on Upgrade! Use only during development. + */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java b/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java index 7fff4ea..14ecd6c 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -29,8 +29,7 @@ private final TaskLocalBeanDao taskLocalBeanDao; private final TaskMarkerLocalBeanDao taskMarkerLocalBeanDao; - public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> - daoConfigMap) { + public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); markerLocalBeanDaoConfig = daoConfigMap.get(MarkerLocalBeanDao.class).clone(); @@ -50,7 +49,7 @@ registerDao(TaskLocalBean.class, taskLocalBeanDao); registerDao(TaskMarkerLocalBean.class, taskMarkerLocalBeanDao); } - + public void clear() { markerLocalBeanDaoConfig.clearIdentityScope(); taskLocalBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java b/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java index 31de1ae..9fd362f 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java +++ b/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java @@ -12,9 +12,10 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** + +/** * DAO for table "MARKER_LOCAL_BEAN". -*/ + */ public class MarkerLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MARKER_LOCAL_BEAN"; @@ -57,14 +58,16 @@ public MarkerLocalBeanDao(DaoConfig config) { super(config); } - + public MarkerLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** Creates the underlying database table. */ + /** + * Creates the underlying database table. + */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; db.execSQL("CREATE TABLE " + constraint + "\"MARKER_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPELINE_TYPE\" TEXT," + // 1: pipelineType @@ -95,7 +98,9 @@ "\"IMAGE_PATH\" TEXT);"); // 26: imagePath } - /** Drops the underlying database table. */ + /** + * Drops the underlying database table. + */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MARKER_LOCAL_BEAN\""; db.execSQL(sql); @@ -104,137 +109,137 @@ @Override protected final void bindValues(DatabaseStatement stmt, MarkerLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipelineType = entity.getPipelineType(); if (pipelineType != null) { stmt.bindString(2, pipelineType); } - + String pipelineDiameter = entity.getPipelineDiameter(); if (pipelineDiameter != null) { stmt.bindString(3, pipelineDiameter); } - + String pipelineMaterial = entity.getPipelineMaterial(); if (pipelineMaterial != null) { stmt.bindString(4, pipelineMaterial); } - + String buryMethod = entity.getBuryMethod(); if (buryMethod != null) { stmt.bindString(5, buryMethod); } - + String buryDepth = entity.getBuryDepth(); if (buryDepth != null) { stmt.bindString(6, buryDepth); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(7, area); } - + String line = entity.getLine(); if (line != null) { stmt.bindString(8, line); } - + String road = entity.getRoad(); if (road != null) { stmt.bindString(9, road); } - + String constructTime = entity.getConstructTime(); if (constructTime != null) { stmt.bindString(10, constructTime); } - + String owner = entity.getOwner(); if (owner != null) { stmt.bindString(11, owner); } - + String objectId = entity.getObjectId(); if (objectId != null) { stmt.bindString(12, objectId); } - + String markerId = entity.getMarkerId(); if (markerId != null) { stmt.bindString(13, markerId); } - + String markerType = entity.getMarkerType(); if (markerType != null) { stmt.bindString(14, markerType); } - + String markerDepth = entity.getMarkerDepth(); if (markerDepth != null) { stmt.bindString(15, markerDepth); } - + String installationDept = entity.getInstallationDept(); if (installationDept != null) { stmt.bindString(16, installationDept); } - + String lng = entity.getLng(); if (lng != null) { stmt.bindString(17, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(18, lat); } - + String updateTime = entity.getUpdateTime(); if (updateTime != null) { stmt.bindString(19, updateTime); } - + String remark = entity.getRemark(); if (remark != null) { stmt.bindString(20, remark); } - + String underlyingPipelineType = entity.getUnderlyingPipelineType(); if (underlyingPipelineType != null) { stmt.bindString(21, underlyingPipelineType); } - + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); if (underlyingPipelineDepth != null) { stmt.bindString(22, underlyingPipelineDepth); } - + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); if (underlyingPipelineDiameter != null) { stmt.bindString(23, underlyingPipelineDiameter); } - + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); if (underlyingPipelineMaterial != null) { stmt.bindString(24, underlyingPipelineMaterial); } - + String objectType = entity.getObjectType(); if (objectType != null) { stmt.bindString(25, objectType); } - + String color = entity.getColor(); if (color != null) { stmt.bindString(26, color); } - + String imagePath = entity.getImagePath(); if (imagePath != null) { stmt.bindString(27, imagePath); @@ -244,137 +249,137 @@ @Override protected final void bindValues(SQLiteStatement stmt, MarkerLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipelineType = entity.getPipelineType(); if (pipelineType != null) { stmt.bindString(2, pipelineType); } - + String pipelineDiameter = entity.getPipelineDiameter(); if (pipelineDiameter != null) { stmt.bindString(3, pipelineDiameter); } - + String pipelineMaterial = entity.getPipelineMaterial(); if (pipelineMaterial != null) { stmt.bindString(4, pipelineMaterial); } - + String buryMethod = entity.getBuryMethod(); if (buryMethod != null) { stmt.bindString(5, buryMethod); } - + String buryDepth = entity.getBuryDepth(); if (buryDepth != null) { stmt.bindString(6, buryDepth); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(7, area); } - + String line = entity.getLine(); if (line != null) { stmt.bindString(8, line); } - + String road = entity.getRoad(); if (road != null) { stmt.bindString(9, road); } - + String constructTime = entity.getConstructTime(); if (constructTime != null) { stmt.bindString(10, constructTime); } - + String owner = entity.getOwner(); if (owner != null) { stmt.bindString(11, owner); } - + String objectId = entity.getObjectId(); if (objectId != null) { stmt.bindString(12, objectId); } - + String markerId = entity.getMarkerId(); if (markerId != null) { stmt.bindString(13, markerId); } - + String markerType = entity.getMarkerType(); if (markerType != null) { stmt.bindString(14, markerType); } - + String markerDepth = entity.getMarkerDepth(); if (markerDepth != null) { stmt.bindString(15, markerDepth); } - + String installationDept = entity.getInstallationDept(); if (installationDept != null) { stmt.bindString(16, installationDept); } - + String lng = entity.getLng(); if (lng != null) { stmt.bindString(17, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(18, lat); } - + String updateTime = entity.getUpdateTime(); if (updateTime != null) { stmt.bindString(19, updateTime); } - + String remark = entity.getRemark(); if (remark != null) { stmt.bindString(20, remark); } - + String underlyingPipelineType = entity.getUnderlyingPipelineType(); if (underlyingPipelineType != null) { stmt.bindString(21, underlyingPipelineType); } - + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); if (underlyingPipelineDepth != null) { stmt.bindString(22, underlyingPipelineDepth); } - + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); if (underlyingPipelineDiameter != null) { stmt.bindString(23, underlyingPipelineDiameter); } - + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); if (underlyingPipelineMaterial != null) { stmt.bindString(24, underlyingPipelineMaterial); } - + String objectType = entity.getObjectType(); if (objectType != null) { stmt.bindString(25, objectType); } - + String color = entity.getColor(); if (color != null) { stmt.bindString(26, color); } - + String imagePath = entity.getImagePath(); if (imagePath != null) { stmt.bindString(27, imagePath); @@ -384,42 +389,42 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MarkerLocalBean readEntity(Cursor cursor, int offset) { MarkerLocalBean entity = new MarkerLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipelineType - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineDiameter - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // buryMethod - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDepth - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // area - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // line - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // road - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // constructTime - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // owner - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // objectId - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // markerId - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // markerType - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // markerDepth - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // installationDept - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // lng - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // lat - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // updateTime - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // remark - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // underlyingPipelineType - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // underlyingPipelineDepth - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // underlyingPipelineDiameter - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // underlyingPipelineMaterial - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // objectType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // color - cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipelineType + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineDiameter + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // buryMethod + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDepth + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // area + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // line + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // road + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // constructTime + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // owner + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // objectId + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // markerId + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // markerType + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // markerDepth + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // installationDept + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // lng + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // lat + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // updateTime + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // remark + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // underlyingPipelineType + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // underlyingPipelineDepth + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // underlyingPipelineDiameter + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // underlyingPipelineMaterial + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // objectType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // color + cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath ); return entity; } - + @Override public void readEntity(Cursor cursor, MarkerLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -449,17 +454,17 @@ entity.setObjectType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setColor(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); - } - + } + @Override protected final Long updateKeyAfterInsert(MarkerLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(MarkerLocalBean entity) { - if(entity != null) { + if (entity != null) { return entity.getId(); } else { return null; @@ -475,5 +480,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/detector/common/greendao/TaskLocalBeanDao.java b/app/src/main/java/com/casic/detector/common/greendao/TaskLocalBeanDao.java index 17c6982..83543b7 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/TaskLocalBeanDao.java +++ b/app/src/main/java/com/casic/detector/common/greendao/TaskLocalBeanDao.java @@ -12,9 +12,10 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** + +/** * DAO for table "TASK_LOCAL_BEAN". -*/ + */ public class TaskLocalBeanDao extends AbstractDao { public static final String TABLENAME = "TASK_LOCAL_BEAN"; @@ -39,14 +40,16 @@ public TaskLocalBeanDao(DaoConfig config) { super(config); } - + public TaskLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** Creates the underlying database table. */ + /** + * Creates the underlying database table. + */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; db.execSQL("CREATE TABLE " + constraint + "\"TASK_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY ," + // 0: id "\"TASK_CODE\" TEXT," + // 1: taskCode @@ -59,7 +62,9 @@ "\"IS_FREE_TASK\" TEXT);"); // 8: isFreeTask } - /** Drops the underlying database table. */ + /** + * Drops the underlying database table. + */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TASK_LOCAL_BEAN\""; db.execSQL(sql); @@ -68,47 +73,47 @@ @Override protected final void bindValues(DatabaseStatement stmt, TaskLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String taskCode = entity.getTaskCode(); if (taskCode != null) { stmt.bindString(2, taskCode); } - + String description = entity.getDescription(); if (description != null) { stmt.bindString(3, description); } - + String createTime = entity.getCreateTime(); if (createTime != null) { stmt.bindString(4, createTime); } - + String status = entity.getStatus(); if (status != null) { stmt.bindString(5, status); } - + String createUserName = entity.getCreateUserName(); if (createUserName != null) { stmt.bindString(6, createUserName); } - + String startTime = entity.getStartTime(); if (startTime != null) { stmt.bindString(7, startTime); } - + String endTime = entity.getEndTime(); if (endTime != null) { stmt.bindString(8, endTime); } - + String isFreeTask = entity.getIsFreeTask(); if (isFreeTask != null) { stmt.bindString(9, isFreeTask); @@ -118,47 +123,47 @@ @Override protected final void bindValues(SQLiteStatement stmt, TaskLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String taskCode = entity.getTaskCode(); if (taskCode != null) { stmt.bindString(2, taskCode); } - + String description = entity.getDescription(); if (description != null) { stmt.bindString(3, description); } - + String createTime = entity.getCreateTime(); if (createTime != null) { stmt.bindString(4, createTime); } - + String status = entity.getStatus(); if (status != null) { stmt.bindString(5, status); } - + String createUserName = entity.getCreateUserName(); if (createUserName != null) { stmt.bindString(6, createUserName); } - + String startTime = entity.getStartTime(); if (startTime != null) { stmt.bindString(7, startTime); } - + String endTime = entity.getEndTime(); if (endTime != null) { stmt.bindString(8, endTime); } - + String isFreeTask = entity.getIsFreeTask(); if (isFreeTask != null) { stmt.bindString(9, isFreeTask); @@ -168,24 +173,24 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public TaskLocalBean readEntity(Cursor cursor, int offset) { TaskLocalBean entity = new TaskLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // taskCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // description - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // status - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // createUserName - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // startTime - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // endTime - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8) // isFreeTask + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // taskCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // description + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // status + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // createUserName + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // startTime + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // endTime + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8) // isFreeTask ); return entity; } - + @Override public void readEntity(Cursor cursor, TaskLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -197,17 +202,17 @@ entity.setStartTime(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); entity.setEndTime(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); entity.setIsFreeTask(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - } - + } + @Override protected final Long updateKeyAfterInsert(TaskLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(TaskLocalBean entity) { - if(entity != null) { + if (entity != null) { return entity.getId(); } else { return null; @@ -223,5 +228,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/detector/common/greendao/TaskMarkerLocalBeanDao.java b/app/src/main/java/com/casic/detector/common/greendao/TaskMarkerLocalBeanDao.java index b2e38af..5870ce4 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/TaskMarkerLocalBeanDao.java +++ b/app/src/main/java/com/casic/detector/common/greendao/TaskMarkerLocalBeanDao.java @@ -12,9 +12,10 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** + +/** * DAO for table "TASK_MARKER_LOCAL_BEAN". -*/ + */ public class TaskMarkerLocalBeanDao extends AbstractDao { public static final String TABLENAME = "TASK_MARKER_LOCAL_BEAN"; @@ -38,14 +39,16 @@ public TaskMarkerLocalBeanDao(DaoConfig config) { super(config); } - + public TaskMarkerLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** Creates the underlying database table. */ + /** + * Creates the underlying database table. + */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; db.execSQL("CREATE TABLE " + constraint + "\"TASK_MARKER_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY ," + // 0: id "\"TASK_ID\" TEXT," + // 1: taskId @@ -57,7 +60,9 @@ "\"DETECTED_TIME\" TEXT);"); // 7: detectedTime } - /** Drops the underlying database table. */ + /** + * Drops the underlying database table. + */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TASK_MARKER_LOCAL_BEAN\""; db.execSQL(sql); @@ -66,34 +71,34 @@ @Override protected final void bindValues(DatabaseStatement stmt, TaskMarkerLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(2, taskId); } - + String taskCode = entity.getTaskCode(); if (taskCode != null) { stmt.bindString(3, taskCode); } - + String markerId = entity.getMarkerId(); if (markerId != null) { stmt.bindString(4, markerId); } stmt.bindDouble(5, entity.getLng()); stmt.bindDouble(6, entity.getLat()); - + String isDetected = entity.getIsDetected(); if (isDetected != null) { stmt.bindString(7, isDetected); } - + String detectedTime = entity.getDetectedTime(); if (detectedTime != null) { stmt.bindString(8, detectedTime); @@ -103,34 +108,34 @@ @Override protected final void bindValues(SQLiteStatement stmt, TaskMarkerLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(2, taskId); } - + String taskCode = entity.getTaskCode(); if (taskCode != null) { stmt.bindString(3, taskCode); } - + String markerId = entity.getMarkerId(); if (markerId != null) { stmt.bindString(4, markerId); } stmt.bindDouble(5, entity.getLng()); stmt.bindDouble(6, entity.getLat()); - + String isDetected = entity.getIsDetected(); if (isDetected != null) { stmt.bindString(7, isDetected); } - + String detectedTime = entity.getDetectedTime(); if (detectedTime != null) { stmt.bindString(8, detectedTime); @@ -140,23 +145,23 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public TaskMarkerLocalBean readEntity(Cursor cursor, int offset) { TaskMarkerLocalBean entity = new TaskMarkerLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // taskId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // taskCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // markerId - cursor.getDouble(offset + 4), // lng - cursor.getDouble(offset + 5), // lat - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // isDetected - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // detectedTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // taskId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // taskCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // markerId + cursor.getDouble(offset + 4), // lng + cursor.getDouble(offset + 5), // lat + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // isDetected + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // detectedTime ); return entity; } - + @Override public void readEntity(Cursor cursor, TaskMarkerLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -167,17 +172,17 @@ entity.setLat(cursor.getDouble(offset + 5)); entity.setIsDetected(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); entity.setDetectedTime(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - + } + @Override protected final Long updateKeyAfterInsert(TaskMarkerLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(TaskMarkerLocalBean entity) { - if(entity != null) { + if (entity != null) { return entity.getId(); } else { return null; @@ -193,5 +198,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/detector/common/uart/JNIKit.java b/app/src/main/java/com/casic/detector/common/uart/JNIKit.java new file mode 100644 index 0000000..24b163f --- /dev/null +++ b/app/src/main/java/com/casic/detector/common/uart/JNIKit.java @@ -0,0 +1,13 @@ +package com.casic.detector.common.uart; + +import java.io.FileDescriptor; + +public class JNIKit { + static { + System.loadLibrary("serial_port"); + } + + public native FileDescriptor open(String path, int baudRate, int flags); + + public native void close(); +} diff --git a/app/src/main/java/com/casic/detector/common/uart/SerialPortKit.java b/app/src/main/java/com/casic/detector/common/uart/SerialPortKit.java deleted file mode 100644 index 731a892..0000000 --- a/app/src/main/java/com/casic/detector/common/uart/SerialPortKit.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.casic.detector.common.uart; - -import java.io.FileDescriptor; - -public class SerialPortKit { - static { - System.loadLibrary("serial_port"); - } - - public native FileDescriptor open(String path, int baudRate, int flags); - - public native void close(); -} diff --git a/app/src/main/cpp/serial_port.cpp b/app/src/main/cpp/serial_port.cpp index 9daa036..6d6601f 100644 --- a/app/src/main/cpp/serial_port.cpp +++ b/app/src/main/cpp/serial_port.cpp @@ -87,7 +87,7 @@ extern "C" JNIEXPORT jobject JNICALL -Java_com_casic_detector_common_uart_SerialPortKit_open(JNIEnv *env, jobject thiz, jstring path, +Java_com_casic_detector_common_uart_JNIKit_open(JNIEnv *env, jobject thiz, jstring path, jint baud_rate, jint flags) { int fd; speed_t speed; @@ -157,7 +157,7 @@ extern "C" JNIEXPORT void JNICALL -Java_com_casic_detector_common_uart_SerialPortKit_close(JNIEnv *env, jobject thiz) { +Java_com_casic_detector_common_uart_JNIKit_close(JNIEnv *env, jobject thiz) { jclass j_fd_class = env->FindClass("java/io/FileDescriptor"); char descriptor_buffer[16] = {0}; diff --git a/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java b/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java index 27e7429..3bba972 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/detector/common/greendao/DaoMaster.java @@ -13,20 +13,25 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. + /** * Master of DAO (schema version 1): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 1; - /** Creates underlying database table using DAOs. */ + /** + * Creates underlying database table using DAOs. + */ public static void createAllTables(Database db, boolean ifNotExists) { MarkerLocalBeanDao.createTable(db, ifNotExists); TaskLocalBeanDao.createTable(db, ifNotExists); TaskMarkerLocalBeanDao.createTable(db, ifNotExists); } - /** Drops underlying database table using DAOs. */ + /** + * Drops underlying database table using DAOs. + */ public static void dropAllTables(Database db, boolean ifExists) { MarkerLocalBeanDao.dropTable(db, ifExists); TaskLocalBeanDao.dropTable(db, ifExists); @@ -81,7 +86,9 @@ } } - /** WARNING: Drops all table on Upgrade! Use only during development. */ + /** + * WARNING: Drops all table on Upgrade! Use only during development. + */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java b/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java index 7fff4ea..14ecd6c 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/detector/common/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -29,8 +29,7 @@ private final TaskLocalBeanDao taskLocalBeanDao; private final TaskMarkerLocalBeanDao taskMarkerLocalBeanDao; - public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> - daoConfigMap) { + public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); markerLocalBeanDaoConfig = daoConfigMap.get(MarkerLocalBeanDao.class).clone(); @@ -50,7 +49,7 @@ registerDao(TaskLocalBean.class, taskLocalBeanDao); registerDao(TaskMarkerLocalBean.class, taskMarkerLocalBeanDao); } - + public void clear() { markerLocalBeanDaoConfig.clearIdentityScope(); taskLocalBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java b/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java index 31de1ae..9fd362f 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java +++ b/app/src/main/java/com/casic/detector/common/greendao/MarkerLocalBeanDao.java @@ -12,9 +12,10 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** + +/** * DAO for table "MARKER_LOCAL_BEAN". -*/ + */ public class MarkerLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MARKER_LOCAL_BEAN"; @@ -57,14 +58,16 @@ public MarkerLocalBeanDao(DaoConfig config) { super(config); } - + public MarkerLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** Creates the underlying database table. */ + /** + * Creates the underlying database table. + */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; db.execSQL("CREATE TABLE " + constraint + "\"MARKER_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPELINE_TYPE\" TEXT," + // 1: pipelineType @@ -95,7 +98,9 @@ "\"IMAGE_PATH\" TEXT);"); // 26: imagePath } - /** Drops the underlying database table. */ + /** + * Drops the underlying database table. + */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MARKER_LOCAL_BEAN\""; db.execSQL(sql); @@ -104,137 +109,137 @@ @Override protected final void bindValues(DatabaseStatement stmt, MarkerLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipelineType = entity.getPipelineType(); if (pipelineType != null) { stmt.bindString(2, pipelineType); } - + String pipelineDiameter = entity.getPipelineDiameter(); if (pipelineDiameter != null) { stmt.bindString(3, pipelineDiameter); } - + String pipelineMaterial = entity.getPipelineMaterial(); if (pipelineMaterial != null) { stmt.bindString(4, pipelineMaterial); } - + String buryMethod = entity.getBuryMethod(); if (buryMethod != null) { stmt.bindString(5, buryMethod); } - + String buryDepth = entity.getBuryDepth(); if (buryDepth != null) { stmt.bindString(6, buryDepth); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(7, area); } - + String line = entity.getLine(); if (line != null) { stmt.bindString(8, line); } - + String road = entity.getRoad(); if (road != null) { stmt.bindString(9, road); } - + String constructTime = entity.getConstructTime(); if (constructTime != null) { stmt.bindString(10, constructTime); } - + String owner = entity.getOwner(); if (owner != null) { stmt.bindString(11, owner); } - + String objectId = entity.getObjectId(); if (objectId != null) { stmt.bindString(12, objectId); } - + String markerId = entity.getMarkerId(); if (markerId != null) { stmt.bindString(13, markerId); } - + String markerType = entity.getMarkerType(); if (markerType != null) { stmt.bindString(14, markerType); } - + String markerDepth = entity.getMarkerDepth(); if (markerDepth != null) { stmt.bindString(15, markerDepth); } - + String installationDept = entity.getInstallationDept(); if (installationDept != null) { stmt.bindString(16, installationDept); } - + String lng = entity.getLng(); if (lng != null) { stmt.bindString(17, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(18, lat); } - + String updateTime = entity.getUpdateTime(); if (updateTime != null) { stmt.bindString(19, updateTime); } - + String remark = entity.getRemark(); if (remark != null) { stmt.bindString(20, remark); } - + String underlyingPipelineType = entity.getUnderlyingPipelineType(); if (underlyingPipelineType != null) { stmt.bindString(21, underlyingPipelineType); } - + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); if (underlyingPipelineDepth != null) { stmt.bindString(22, underlyingPipelineDepth); } - + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); if (underlyingPipelineDiameter != null) { stmt.bindString(23, underlyingPipelineDiameter); } - + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); if (underlyingPipelineMaterial != null) { stmt.bindString(24, underlyingPipelineMaterial); } - + String objectType = entity.getObjectType(); if (objectType != null) { stmt.bindString(25, objectType); } - + String color = entity.getColor(); if (color != null) { stmt.bindString(26, color); } - + String imagePath = entity.getImagePath(); if (imagePath != null) { stmt.bindString(27, imagePath); @@ -244,137 +249,137 @@ @Override protected final void bindValues(SQLiteStatement stmt, MarkerLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipelineType = entity.getPipelineType(); if (pipelineType != null) { stmt.bindString(2, pipelineType); } - + String pipelineDiameter = entity.getPipelineDiameter(); if (pipelineDiameter != null) { stmt.bindString(3, pipelineDiameter); } - + String pipelineMaterial = entity.getPipelineMaterial(); if (pipelineMaterial != null) { stmt.bindString(4, pipelineMaterial); } - + String buryMethod = entity.getBuryMethod(); if (buryMethod != null) { stmt.bindString(5, buryMethod); } - + String buryDepth = entity.getBuryDepth(); if (buryDepth != null) { stmt.bindString(6, buryDepth); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(7, area); } - + String line = entity.getLine(); if (line != null) { stmt.bindString(8, line); } - + String road = entity.getRoad(); if (road != null) { stmt.bindString(9, road); } - + String constructTime = entity.getConstructTime(); if (constructTime != null) { stmt.bindString(10, constructTime); } - + String owner = entity.getOwner(); if (owner != null) { stmt.bindString(11, owner); } - + String objectId = entity.getObjectId(); if (objectId != null) { stmt.bindString(12, objectId); } - + String markerId = entity.getMarkerId(); if (markerId != null) { stmt.bindString(13, markerId); } - + String markerType = entity.getMarkerType(); if (markerType != null) { stmt.bindString(14, markerType); } - + String markerDepth = entity.getMarkerDepth(); if (markerDepth != null) { stmt.bindString(15, markerDepth); } - + String installationDept = entity.getInstallationDept(); if (installationDept != null) { stmt.bindString(16, installationDept); } - + String lng = entity.getLng(); if (lng != null) { stmt.bindString(17, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(18, lat); } - + String updateTime = entity.getUpdateTime(); if (updateTime != null) { stmt.bindString(19, updateTime); } - + String remark = entity.getRemark(); if (remark != null) { stmt.bindString(20, remark); } - + String underlyingPipelineType = entity.getUnderlyingPipelineType(); if (underlyingPipelineType != null) { stmt.bindString(21, underlyingPipelineType); } - + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); if (underlyingPipelineDepth != null) { stmt.bindString(22, underlyingPipelineDepth); } - + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); if (underlyingPipelineDiameter != null) { stmt.bindString(23, underlyingPipelineDiameter); } - + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); if (underlyingPipelineMaterial != null) { stmt.bindString(24, underlyingPipelineMaterial); } - + String objectType = entity.getObjectType(); if (objectType != null) { stmt.bindString(25, objectType); } - + String color = entity.getColor(); if (color != null) { stmt.bindString(26, color); } - + String imagePath = entity.getImagePath(); if (imagePath != null) { stmt.bindString(27, imagePath); @@ -384,42 +389,42 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MarkerLocalBean readEntity(Cursor cursor, int offset) { MarkerLocalBean entity = new MarkerLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipelineType - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineDiameter - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // buryMethod - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDepth - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // area - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // line - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // road - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // constructTime - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // owner - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // objectId - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // markerId - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // markerType - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // markerDepth - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // installationDept - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // lng - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // lat - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // updateTime - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // remark - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // underlyingPipelineType - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // underlyingPipelineDepth - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // underlyingPipelineDiameter - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // underlyingPipelineMaterial - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // objectType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // color - cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipelineType + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineDiameter + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // buryMethod + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDepth + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // area + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // line + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // road + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // constructTime + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // owner + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // objectId + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // markerId + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // markerType + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // markerDepth + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // installationDept + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // lng + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // lat + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // updateTime + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // remark + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // underlyingPipelineType + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // underlyingPipelineDepth + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // underlyingPipelineDiameter + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // underlyingPipelineMaterial + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // objectType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // color + cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath ); return entity; } - + @Override public void readEntity(Cursor cursor, MarkerLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -449,17 +454,17 @@ entity.setObjectType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setColor(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); - } - + } + @Override protected final Long updateKeyAfterInsert(MarkerLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(MarkerLocalBean entity) { - if(entity != null) { + if (entity != null) { return entity.getId(); } else { return null; @@ -475,5 +480,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/detector/common/greendao/TaskLocalBeanDao.java b/app/src/main/java/com/casic/detector/common/greendao/TaskLocalBeanDao.java index 17c6982..83543b7 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/TaskLocalBeanDao.java +++ b/app/src/main/java/com/casic/detector/common/greendao/TaskLocalBeanDao.java @@ -12,9 +12,10 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** + +/** * DAO for table "TASK_LOCAL_BEAN". -*/ + */ public class TaskLocalBeanDao extends AbstractDao { public static final String TABLENAME = "TASK_LOCAL_BEAN"; @@ -39,14 +40,16 @@ public TaskLocalBeanDao(DaoConfig config) { super(config); } - + public TaskLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** Creates the underlying database table. */ + /** + * Creates the underlying database table. + */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; db.execSQL("CREATE TABLE " + constraint + "\"TASK_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY ," + // 0: id "\"TASK_CODE\" TEXT," + // 1: taskCode @@ -59,7 +62,9 @@ "\"IS_FREE_TASK\" TEXT);"); // 8: isFreeTask } - /** Drops the underlying database table. */ + /** + * Drops the underlying database table. + */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TASK_LOCAL_BEAN\""; db.execSQL(sql); @@ -68,47 +73,47 @@ @Override protected final void bindValues(DatabaseStatement stmt, TaskLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String taskCode = entity.getTaskCode(); if (taskCode != null) { stmt.bindString(2, taskCode); } - + String description = entity.getDescription(); if (description != null) { stmt.bindString(3, description); } - + String createTime = entity.getCreateTime(); if (createTime != null) { stmt.bindString(4, createTime); } - + String status = entity.getStatus(); if (status != null) { stmt.bindString(5, status); } - + String createUserName = entity.getCreateUserName(); if (createUserName != null) { stmt.bindString(6, createUserName); } - + String startTime = entity.getStartTime(); if (startTime != null) { stmt.bindString(7, startTime); } - + String endTime = entity.getEndTime(); if (endTime != null) { stmt.bindString(8, endTime); } - + String isFreeTask = entity.getIsFreeTask(); if (isFreeTask != null) { stmt.bindString(9, isFreeTask); @@ -118,47 +123,47 @@ @Override protected final void bindValues(SQLiteStatement stmt, TaskLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String taskCode = entity.getTaskCode(); if (taskCode != null) { stmt.bindString(2, taskCode); } - + String description = entity.getDescription(); if (description != null) { stmt.bindString(3, description); } - + String createTime = entity.getCreateTime(); if (createTime != null) { stmt.bindString(4, createTime); } - + String status = entity.getStatus(); if (status != null) { stmt.bindString(5, status); } - + String createUserName = entity.getCreateUserName(); if (createUserName != null) { stmt.bindString(6, createUserName); } - + String startTime = entity.getStartTime(); if (startTime != null) { stmt.bindString(7, startTime); } - + String endTime = entity.getEndTime(); if (endTime != null) { stmt.bindString(8, endTime); } - + String isFreeTask = entity.getIsFreeTask(); if (isFreeTask != null) { stmt.bindString(9, isFreeTask); @@ -168,24 +173,24 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public TaskLocalBean readEntity(Cursor cursor, int offset) { TaskLocalBean entity = new TaskLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // taskCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // description - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // status - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // createUserName - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // startTime - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // endTime - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8) // isFreeTask + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // taskCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // description + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // status + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // createUserName + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // startTime + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // endTime + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8) // isFreeTask ); return entity; } - + @Override public void readEntity(Cursor cursor, TaskLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -197,17 +202,17 @@ entity.setStartTime(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); entity.setEndTime(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); entity.setIsFreeTask(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - } - + } + @Override protected final Long updateKeyAfterInsert(TaskLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(TaskLocalBean entity) { - if(entity != null) { + if (entity != null) { return entity.getId(); } else { return null; @@ -223,5 +228,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/detector/common/greendao/TaskMarkerLocalBeanDao.java b/app/src/main/java/com/casic/detector/common/greendao/TaskMarkerLocalBeanDao.java index b2e38af..5870ce4 100644 --- a/app/src/main/java/com/casic/detector/common/greendao/TaskMarkerLocalBeanDao.java +++ b/app/src/main/java/com/casic/detector/common/greendao/TaskMarkerLocalBeanDao.java @@ -12,9 +12,10 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** + +/** * DAO for table "TASK_MARKER_LOCAL_BEAN". -*/ + */ public class TaskMarkerLocalBeanDao extends AbstractDao { public static final String TABLENAME = "TASK_MARKER_LOCAL_BEAN"; @@ -38,14 +39,16 @@ public TaskMarkerLocalBeanDao(DaoConfig config) { super(config); } - + public TaskMarkerLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** Creates the underlying database table. */ + /** + * Creates the underlying database table. + */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; db.execSQL("CREATE TABLE " + constraint + "\"TASK_MARKER_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY ," + // 0: id "\"TASK_ID\" TEXT," + // 1: taskId @@ -57,7 +60,9 @@ "\"DETECTED_TIME\" TEXT);"); // 7: detectedTime } - /** Drops the underlying database table. */ + /** + * Drops the underlying database table. + */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TASK_MARKER_LOCAL_BEAN\""; db.execSQL(sql); @@ -66,34 +71,34 @@ @Override protected final void bindValues(DatabaseStatement stmt, TaskMarkerLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(2, taskId); } - + String taskCode = entity.getTaskCode(); if (taskCode != null) { stmt.bindString(3, taskCode); } - + String markerId = entity.getMarkerId(); if (markerId != null) { stmt.bindString(4, markerId); } stmt.bindDouble(5, entity.getLng()); stmt.bindDouble(6, entity.getLat()); - + String isDetected = entity.getIsDetected(); if (isDetected != null) { stmt.bindString(7, isDetected); } - + String detectedTime = entity.getDetectedTime(); if (detectedTime != null) { stmt.bindString(8, detectedTime); @@ -103,34 +108,34 @@ @Override protected final void bindValues(SQLiteStatement stmt, TaskMarkerLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(2, taskId); } - + String taskCode = entity.getTaskCode(); if (taskCode != null) { stmt.bindString(3, taskCode); } - + String markerId = entity.getMarkerId(); if (markerId != null) { stmt.bindString(4, markerId); } stmt.bindDouble(5, entity.getLng()); stmt.bindDouble(6, entity.getLat()); - + String isDetected = entity.getIsDetected(); if (isDetected != null) { stmt.bindString(7, isDetected); } - + String detectedTime = entity.getDetectedTime(); if (detectedTime != null) { stmt.bindString(8, detectedTime); @@ -140,23 +145,23 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public TaskMarkerLocalBean readEntity(Cursor cursor, int offset) { TaskMarkerLocalBean entity = new TaskMarkerLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // taskId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // taskCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // markerId - cursor.getDouble(offset + 4), // lng - cursor.getDouble(offset + 5), // lat - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // isDetected - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // detectedTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // taskId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // taskCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // markerId + cursor.getDouble(offset + 4), // lng + cursor.getDouble(offset + 5), // lat + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // isDetected + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // detectedTime ); return entity; } - + @Override public void readEntity(Cursor cursor, TaskMarkerLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -167,17 +172,17 @@ entity.setLat(cursor.getDouble(offset + 5)); entity.setIsDetected(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); entity.setDetectedTime(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - + } + @Override protected final Long updateKeyAfterInsert(TaskMarkerLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(TaskMarkerLocalBean entity) { - if(entity != null) { + if (entity != null) { return entity.getId(); } else { return null; @@ -193,5 +198,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/detector/common/uart/JNIKit.java b/app/src/main/java/com/casic/detector/common/uart/JNIKit.java new file mode 100644 index 0000000..24b163f --- /dev/null +++ b/app/src/main/java/com/casic/detector/common/uart/JNIKit.java @@ -0,0 +1,13 @@ +package com.casic.detector.common.uart; + +import java.io.FileDescriptor; + +public class JNIKit { + static { + System.loadLibrary("serial_port"); + } + + public native FileDescriptor open(String path, int baudRate, int flags); + + public native void close(); +} diff --git a/app/src/main/java/com/casic/detector/common/uart/SerialPortKit.java b/app/src/main/java/com/casic/detector/common/uart/SerialPortKit.java deleted file mode 100644 index 731a892..0000000 --- a/app/src/main/java/com/casic/detector/common/uart/SerialPortKit.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.casic.detector.common.uart; - -import java.io.FileDescriptor; - -public class SerialPortKit { - static { - System.loadLibrary("serial_port"); - } - - public native FileDescriptor open(String path, int baudRate, int flags); - - public native void close(); -} diff --git a/app/src/main/java/com/casic/detector/common/utils/SerialPort.kt b/app/src/main/java/com/casic/detector/common/utils/SerialPort.kt index fa15703..0bd69ef 100644 --- a/app/src/main/java/com/casic/detector/common/utils/SerialPort.kt +++ b/app/src/main/java/com/casic/detector/common/utils/SerialPort.kt @@ -1,7 +1,7 @@ package com.casic.detector.common.utils import android.util.Log -import com.casic.detector.common.uart.SerialPortKit +import com.casic.detector.common.uart.JNIKit import java.io.File import java.io.FileInputStream import java.io.FileOutputStream @@ -12,7 +12,7 @@ class SerialPort(device: File, baudRate: Int, flags: Int) { private val kTag = "SerialPort" - private val serialPortKit by lazy { SerialPortKit() } + private val jni by lazy { JNIKit() } var inputStream: InputStream var outputStream: OutputStream @@ -30,7 +30,7 @@ throw SecurityException() } } - val fd = serialPortKit.open(device.absolutePath, baudRate, flags) + val fd = jni.open(device.absolutePath, baudRate, flags) if (fd == null) { Log.e(kTag, "SerialPortKit open returns null") throw IOException() @@ -40,6 +40,6 @@ } fun close() { - serialPortKit.close() + jni.close() } } \ No newline at end of file