BadCase自定义录包兼容老MAP版本
This commit is contained in:
@@ -107,8 +107,24 @@ internal object BadCaseManager : LifecycleEventObserver {
|
||||
if(ClickUtils.isFastClick()){
|
||||
if(NetworkUtils.isConnected()){
|
||||
if(BadCaseConfig.dockerVersion!=null){
|
||||
val caseListDialog = CaseListDialog(activity)
|
||||
caseListDialog.show()
|
||||
//兼容老MAP版本
|
||||
if(BadCaseConfig.dockerVersion!!.contains("2.3.0")
|
||||
|| BadCaseConfig.dockerVersion!!.contains("2.4.0")
|
||||
|| BadCaseConfig.dockerVersion!!.contains("2.5.0")
|
||||
|| BadCaseConfig.dockerVersion!!.contains("2.6.0")
|
||||
|| BadCaseConfig.dockerVersion!!.contains("2.8.0")){
|
||||
val initiativeBadCaseWindow = InitiativeBadCaseWindow(activity)
|
||||
initiativeBadCaseWindow.setClickListener(object: InitiativeBadCaseWindow.ClickListener{
|
||||
override fun closeWindow() {
|
||||
initiativeBadCaseWindow.hideFloatWindow()
|
||||
}
|
||||
|
||||
})
|
||||
initiativeBadCaseWindow.showFloatWindow(null)
|
||||
}else{
|
||||
val caseListDialog = CaseListDialog(activity)
|
||||
caseListDialog.show()
|
||||
}
|
||||
}else{
|
||||
ToastUtils.showShort("工控机连接状态异常")
|
||||
}
|
||||
|
||||
@@ -185,11 +185,13 @@ public class CaseTopicListDialog extends Dialog implements IMoGoAutopilotRecordL
|
||||
@Override
|
||||
public void onAutopilotRecordConfig(MessagePad.RecordDataConfig config) {
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
Log.i("houyanli","AllTopicsCount="+config.getAllTopicsCount());
|
||||
if(config.getAllTopicsCount()>0){
|
||||
for(int index=0;index<config.getAllTopicsCount();index++){
|
||||
if(!recordType.getTopicsList().contains(config.getAllTopics(index))){
|
||||
allTopicList.add(new TopicEntity(config.getAllTopics(index),false,true));
|
||||
}
|
||||
Log.i("houyanli","topic="+config.getAllTopics(index));
|
||||
}
|
||||
recordType.getTopicsList().addAll(allTopicList);
|
||||
topicListAdapter.setData(recordType.getTopicsList());
|
||||
|
||||
@@ -331,7 +331,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
return true
|
||||
}
|
||||
|
||||
fun showFloatWindow(recordCaseEntity: RecordCaseEntity) {
|
||||
fun showFloatWindow(recordCaseEntity: RecordCaseEntity?) {
|
||||
if (mFloatLayout.parent == null) {
|
||||
val metrics = DisplayMetrics()
|
||||
// 默认固定位置,靠屏幕右边缘的中间
|
||||
@@ -340,8 +340,13 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
mWindowParams!!.y = metrics.heightPixels / 2 - getSysBarHeight(mActivity)-350
|
||||
mWindowManager!!.addView(mFloatLayout, mWindowParams)
|
||||
//开启录包
|
||||
CallerAutoPilotManager.recordPackage(recordCaseEntity.caseId,Random(SystemClock.elapsedRealtime()).nextInt(),
|
||||
BadCaseConfig.totalDuration, BadCaseConfig.previousDuration,recordCaseEntity.topicList)
|
||||
if(recordCaseEntity!=null){
|
||||
CallerAutoPilotManager.recordPackage(recordCaseEntity.caseId,Random(SystemClock.elapsedRealtime()).nextInt(),
|
||||
BadCaseConfig.totalDuration, BadCaseConfig.previousDuration,recordCaseEntity.topicList)
|
||||
}else{
|
||||
CallerAutoPilotManager.recordPackage(BadCaseConfig.type,Random(SystemClock.elapsedRealtime()).nextInt(),
|
||||
BadCaseConfig.totalDuration, BadCaseConfig.previousDuration)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user