offine离线模式回放
1、offine离线模式回放
首先点击Analysis-->Measurement Setup打开设置框图 ,其次加载文件、切换离线模式、设置Trace、设置Graphics。(注意一般回放配置的通道数以及arxml尽量与录制报文保持一致)
2、加载报文,双击上面的(框框2);配置完点击start运行,相应的数据查找可以在trace或者Graphics 查看
在线回放
1、对于在线回放需要再 online模式下
2、添加 insert Replay Block Can 节点
3、右击这个节点选择相应的配置
4、添加这样回放的时候就可以按照录取log的速度查看回放log了;同时也可以添加CAPL代码节点进行分析
includes { } variables { int count=0; } on PDU IBS** #此PDU举例 具体写上自己的pdu { if(this.IBrkPdlAppd.phys==1) { count++; write(" received at: %d ,个数%d", this.time,count); } }
5、回放代码控制配置编写
CAPL脚本编程中对replay block模块控制的函数如下:
函数 作用 示例 返回值
replayStart () 启动replay模块 replayStart( replayName) 1:成功 0 :失败
replayStop() 停止replay模块 replayStop( replayName) 1:成功 0 :失败
replayState() 查询replay模块状态 replayState( replayName) 0:停止 1:运行
2 :暂停 -1: 模块不存在
replaySuspend() 暂停replay模块 replaySuspend( replayName) 1:成功
0 :失败
replayResume() 恢复播放暂停的replay模块 replayResume( replayName) 1:成功
0 :失败
/*@!Encoding:1252*/
includes
{
}
variables
{
char replayName[32] = "ReplayBlock_IMU";
int replay_states;
int IIMU_GNSS_Signal_Status_return;
}
void Fun_replay_states(int a)
{
switch ( a )
{
case 0:
write( "Replay Block %s is stopped", replayName);
break;
case 1:
write( "Replay Block %s is running", replayName);
break;
case 2:
write( "Replay Block %s is suspended", replayName);
break;
default:
write( "Error: Replay Block %s has an unknown state!", replayName);
break;
}
}
on PDU IMU_SecInfo_FrP03
{
IIMU_GNSS_Signal_Status_return=this.IIMU_GNSS_Signal_Status;
write("this.IIMU_GNSS_Signal_Status %d",IIMU_GNSS_Signal_Status_return);
}
// replayStart () ??replay?? // replayStop() ??replay??
//replaySuspend() ??replay?? //replayResume() ???????replay??
//replayState() ??replay????
testcase TC_replayState_Status()
{
TestCaseTitle("", "TC_replayState_Status");
TestCaseDescription("TC_replayState_Status Is Or Not Is 2");
write("replayState");
replay_states=replayState(replayName);
Fun_replay_states(replay_states);
switch ( replay_states )
{
case 0:
write( "Replay Block %s is stopped", replayName);
break;
case 1:
write( "Replay Block %s is running", replayName);
break;
case 2:
write( "Replay Block %s is suspended", replayName);
break;
default:
write( "Error: Replay Block %s has an unknown state!", replayName);
break;
}
}
testcase TC_replayStart()
{
TestCaseTitle("", "TC_replayStart");
TestCaseDescription("TC_replayStart Is Or Not successful");
write("replayStart");
replay_states=replayStart(replayName);
if(replay_states==1)
{
testStepPass("","replayStart start successful");
}
else
{
testStepFail("","If the Replay Block does not exist or cannot be restarted");
}
}
testcase TC_replayStop()
{
write("replayStop");
replay_states=replayStop(replayName);
if(replay_states==1)
{
testStepPass("","replayStart stop successful");
}
else
{
testStepFail("","If the Replay Block does not exist or cannot be restarted");
}
Fun_replay_states(replay_states);
}
on Signal_change CAN6::IMU_SecInfo_FrP03::IIMU_GNSS_Signal_Status
{
// TC_replayStop();
if(this==2)
{
TC_replayStop();
testWaitForTimeout(30*1000);
}
}
void MainTest ()
{
TC_replayState_Status();
TC_replayStart();
testWaitForTimeout(300*1000);
}