Commit 097191ee authored by predusi's avatar predusi
Browse files

-- changed the name of the components, ports, timer etc from obu to rsu and from rsu to obu.

-- adapted the regex pattern so that it removes the path of the file from the power parameter
parent a7a4a8f9
Loading
Loading
Loading
Loading
+15 −14
Original line number Diff line number Diff line
@@ -8,16 +8,17 @@ module TraceParserSystem {
    //<PowerLevel>_<OBUName>_<DutyCycle>_<RepNo>  
    
    template charstring word := pattern "[^_]+";
    template charstring filePattern := pattern "({word})_({word})_({word})_({word}).(*)";
//    template charstring filePattern := pattern "({word})_({word})_({word})_({word}).(*)";
    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);
        p_Powerlevel := regexp(p_FileName, filePattern, 1);
//        log("p_Powerlevel= " & p_Powerlevel);
        p_OBUName := regexp(p_FileName, filePattern, 1);
        p_OBUName := regexp(p_FileName, filePattern, 2);
//        log("p_OBUName " & p_OBUName);
        p_DutyCycle := regexp(p_FileName, filePattern, 2);
        p_DutyCycle := regexp(p_FileName, filePattern, 3);
//        log("p_DutyCycle " & p_DutyCycle);
        p_RepNo := regexp(p_FileName, filePattern, 3);
        p_RepNo := regexp(p_FileName, filePattern, 4);
//        log("p_RepNo " & p_RepNo);
    }
    
@@ -59,18 +60,18 @@ module TraceParserSystem {
    /**
     * @desc Defines a component type that will be used later as mtc
     */
    type component ObuType { //downLinkType
        port TraceMsgPortType obuPort;
    type component RsuType { //downLinkType
        port TraceMsgPortType rsuPort;
        port CompPortType compPort;
        port CommunPortOBURSUType commmunOBURSUPort;
        timer transactionOBUTimer := 1.0 ;
        timer transactionRSUTimer := 1.0 ;
    }
    
    type component RsuType { //upLinkType
        port TraceMsgPortType rsuPort;
    type component ObuType { //upLinkType
        port TraceMsgPortType obuPort;
        port CompPortType compPort;
        port CommunPortOBURSUType commmunOBURSUPort;
        timer transactionRSUTimer := 1.0 ;
        timer transactionOBUTimer := 1.0 ;
    }
    
    group payloadTypes {
@@ -106,7 +107,7 @@ module TraceParserSystem {
    
    type integer NrOfEmptyMsg;
     
    template PayloadStructure mw_obuBroadCastMsg := {
    template PayloadStructure mw_rsuBroadCastMsg := {
        broadcastMsg := {
            broadcast :=  'FF'O,
            msg := ?