Canoe 回放工程方式

                                    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);
  
  
  

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值