[sweeper-cloud] feat: 增加 查询当前任务 云控接口mock ;

This commit is contained in:
aibingbing
2023-05-16 16:16:29 +08:00
parent aff744f816
commit 2caaaa3135
4 changed files with 30 additions and 7 deletions

View File

@@ -118,6 +118,10 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
setMessageBox();
//设置左下角四个按钮监听事件
setBottomBtnListener();
// 模拟 查询当前任务
findViewById(R.id.btnQueryCurrentTask).setOnClickListener(view ->
SweeperCloudTaskUtils.mockQueryCurrentTaskInfo()
);
// 模拟 云端发送任务
findViewById(R.id.btnSendTask).setOnClickListener(view ->
mockSendCloudTaskInfo()

View File

@@ -300,6 +300,7 @@ public class SweeperTaskModel implements IMoGoSweeperFutianCloudTaskListener, IM
@Override
public void onSweeperFutianCloudTask(@NonNull SweeperCloudTask.MessageType messageType, String reqNo, long sysTime,
SweeperTask.TaskInfo taskInfo) {
if (taskInfo != null) {
CallerLogger.INSTANCE.d(M_SWEEPER + TAG,
"onSweeperFutianCloudTask" + printMessage(taskInfo) + "mSweeperTaskCallback" + mSweeperTaskCallback);
@@ -461,9 +462,9 @@ public class SweeperTaskModel implements IMoGoSweeperFutianCloudTaskListener, IM
CallerLogger.INSTANCE.d(M_SWEEPER + TAG, "getCurrentTask:" + printMessage(getTaskReq) + " reqNo:" + reqNo);
getAutoPilotControlManager().sendSweeperGetTaskReq(reqNo, getTaskReq);
// TODO: 2023/5/5 模拟云控获取任务
UiThreadHandler.postDelayed(() -> {
SweeperCloudTaskUtils.mockSendCloudTaskInfo(SweeperCloudTask.MessageType.PadSendGetTaskReq);
}, 1000);
// UiThreadHandler.postDelayed(() -> {
// SweeperCloudTaskUtils.mockSendCloudTaskInfo(SweeperCloudTask.MessageType.PadSendGetTaskReq);
// }, 1000);
}

View File

@@ -22,6 +22,14 @@ import com.zhjt.mogo.adas.data.sweeper.task.stop.SweeperTaskStop
object SweeperCloudTaskUtils {
const val TAG = "SweeperCloudTaskUtils"
/**
* 模拟发送查询当前任务的请求
*/
@JvmStatic
fun mockQueryCurrentTaskInfo() {
SweeperTaskModel.getInstance().getCurrentTask()
}
/**
* 模拟云控发送任务给pad
*/

View File

@@ -196,16 +196,26 @@
tools:visibility="visible" />
<Button
android:id="@+id/btnSendTask"
android:id="@+id/btnQueryCurrentTask"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_200"
android:background="#f00"
android:text="发送任务"
android:background="#f80"
android:text="查询当前任务"
android:textSize="30sp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/btnSendTask"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#f00"
android:text="发送任务"
android:textSize="30sp"
app:layout_constraintRight_toRightOf="@+id/btnQueryCurrentTask"
app:layout_constraintTop_toBottomOf="@+id/btnQueryCurrentTask" />
<Button
android:id="@+id/btnSendSubTaskConfirm"
android:layout_width="wrap_content"
@@ -253,7 +263,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:constraint_referenced_ids="btnSendTask,btnSendSubTaskConfirm,btnSendEndTask
app:constraint_referenced_ids="btnQueryCurrentTask,btnSendTask,btnSendSubTaskConfirm,btnSendEndTask
,btnSendSubtaskStatus,btnSendTaskStatus"
tools:visibility="visible" />