Commit fb6f423c authored by predusi's avatar predusi
Browse files

implemented the parsing of the trace file named as discussed.

parent 2b12b4a7
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -4,6 +4,23 @@ module TraceParserSystem {
    /* @desc Maximum allowed number of empty uplink frames from the On Board Unit (OBU) */
    modulepar integer PX_MAX_NUM_EMPTY_UPLINK_FRAMES:= 100;
    
    //<PowerLevel>_<OBUName>_<DutyCycle>_<RepNo>  
    
    template charstring word := pattern "[^_]+";
    template charstring filePattern := pattern "({word})_({word})_({word})_({word}).(*)";
    
    function parseFileName(in charstring p_FileName, out charstring p_Powerlevel, out charstring p_OBUName, out charstring p_DutyCycle, out charstring p_RepNo) runs on MtcType{
        p_Powerlevel := regexp(p_FileName, filePattern, 0);
//        log("p_Powerlevel= " & p_Powerlevel);
        p_OBUName := regexp(p_FileName, filePattern, 1);
//        log("p_OBUName " & p_OBUName);
        p_DutyCycle := regexp(p_FileName, filePattern, 2);
//        log("p_DutyCycle " & p_DutyCycle);
        p_RepNo := regexp(p_FileName, filePattern, 3);
//        log("p_RepNo " & p_RepNo);
    }
    
    
    type port TraceMsgPortType message{
        in PayloadStructure;
    }