From 2236fda2f21d65aebf7ce004eeef74f159517673 Mon Sep 17 00:00:00 2001 From: renwj Date: Thu, 27 Jan 2022 14:52:27 +0800 Subject: [PATCH] =?UTF-8?q?[BadCase]=E6=97=A5=E6=9C=9F=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mogo/functions/test/AutoPilotBadCaseTest.kt | 6 +++--- .../com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt | 6 +++--- .../com/mogo/eagle/core/data/autopilot/AutoPilotRecord.kt | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/androidTest/java/com/mogo/functions/test/AutoPilotBadCaseTest.kt b/app/src/androidTest/java/com/mogo/functions/test/AutoPilotBadCaseTest.kt index a1b7cf49b3..29a8fd3427 100644 --- a/app/src/androidTest/java/com/mogo/functions/test/AutoPilotBadCaseTest.kt +++ b/app/src/androidTest/java/com/mogo/functions/test/AutoPilotBadCaseTest.kt @@ -46,7 +46,7 @@ class AutoPilotBadCaseTest { it.key = "yyy_$index" it.stat = 100 it.type = 1 - it.timestamp = SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(Date()) + it.timestamp = SimpleDateFormat("yyyyMMddHHmmss").format(Date()) index++ }) } @@ -77,7 +77,7 @@ class AutoPilotBadCaseTest { it.key = "yyy_$index" it.stat = 100 it.type = 1 - it.timestamp = SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(Date()) + it.timestamp = SimpleDateFormat("yyyyMMddHHmmss").format(Date()) index++ }) @@ -108,7 +108,7 @@ class AutoPilotBadCaseTest { it.key = "yyy_$index" it.stat = 100 it.type = 1 - it.timestamp = SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(Date()) + it.timestamp = SimpleDateFormat("yyyyMMddHHmmss").format(Date()) index++ }) } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt index d236813e85..ca649913ed 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt @@ -107,7 +107,7 @@ class MoGoHmiFragment : MvpFragment Log.d("QQQ", "-- step -- 1 --") var oldT = try { old?.timestamp?.takeIf { it.isNotBlank() }?.let { - SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.getDefault()).parse(it)?.time ?: 0L + SimpleDateFormat("yyyyMMddHHmmss", Locale.getDefault()).parse(it)?.time ?: 0L } ?: 0L } catch (t: Throwable) { t.printStackTrace() @@ -116,7 +116,7 @@ class MoGoHmiFragment : MvpFragment var record: AutoPilotRecordResult? = null var newT = try { it.receive()?.also { record = it }?.timestamp?.takeIf { it.isNotBlank() }?.let { - SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.getDefault()).parse(it)?.time + SimpleDateFormat("yyyyMMddHHmmss", Locale.getDefault()).parse(it)?.time ?: 0L } ?: 0L } catch (t: Throwable) { @@ -140,7 +140,7 @@ class MoGoHmiFragment : MvpFragment it.receive()?.also { record = it }?.timestamp?.takeIf { it.isNotBlank() }?.let { - SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.getDefault()).parse(it)?.time ?: 0L + SimpleDateFormat("yyyyMMddHHmmss", Locale.getDefault()).parse(it)?.time ?: 0L } ?: 0L } catch (t: Throwable) { t.printStackTrace() diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutoPilotRecord.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutoPilotRecord.kt index 6a0dfa92f8..efdb09d327 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutoPilotRecord.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutoPilotRecord.kt @@ -63,7 +63,7 @@ class AutoPilotRecordResult { * 时间戳,格式:YYYY-MM-DD-hh-mm-ss */ @PrimaryKey - var timestamp: String = SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.getDefault()).format(Date()) + var timestamp: String = SimpleDateFormat("yyyyMMddHHmmss", Locale.getDefault()).format(Date()) /** * 此次采集数据总大小(M)