Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2084750
  • 博文数量: 414
  • 博客积分: 10312
  • 博客等级: 上将
  • 技术积分: 4921
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-31 01:49
文章分类

全部博文(414)

文章存档

2011年(1)

2010年(29)

2009年(82)

2008年(301)

2007年(1)

分类:

2008-08-25 10:25:33

模本一:  文件解析
 

        #find the command of "C7SPP:SP=ALL"
        if($line =~ /^<c7spp:sp=all;/i ){#print "88\n";
            #find the next line
            while($line=<dataFileHandle>){
                #find the matching line

                if($line=~/^(\d+)-(\d+)\s+OWNSP\s+(\S+)/){
                    $mtpSignPointId14 = $1."-".$2;
                    $userLabel14=$3;
                    $networkIndicator14=$1;
                    $pointCode14=$2;
                    $pointCodeLength14=1;
                    next;    
                }
                #find the matching line

                if($line=~/^(\d+)-(\d+)-(\d+)-(\d+)\s+OWNSP\s+(\S+)/){
                    $mtpSignPointId24 = $1."-".$2."-".$3."-".$4;
                    $userLabel24=$5;
                    $networkIndicator24=$1;
                    $pointCode24=$4;
                    $pointCodeLength24=0;
                    next;    
                }
                #if the line in which has "END", the loop will break

                if($line=~/^END/){
                    last;
                }                            
            }
        }

 

模本二: 文件读取

    my($line);
    #open the source file,if failed to open ,it will give a note

        open(dataFileHandle, $outFile)|| die "can not open data file: $outFile";
        #find from the first line

        while ( $line=<dataFileHandle>)
        {
            

 

模本三: 变量声明

my($hlr,$hlrId, $dn, $outFile,$exportFile);
my($hlrNumber, $hlrCapacity, $controlledRncList,$maxNum2MPort);
my($num2MCircuits,$maxNum155MPort,$num155MCircuits,$relatedIwf,$administrativeState);
my($operationalState,$mccList,$mncList,$hlrId);
my(%supportedServicesComplex,@supportedServicesList,$supportedServicesNum,$supportedServices);
my($i ,$j,$maxNumImsi,$administrativeState,$operationalState);
my($mtpSignPoint,$mtpSignPointId,$pointCode, $networkIndicator, $pointCodeLength);
my(@signLinkSetTp,$signLinkSetTpNum, $signLinkSetTpDN,@adjPc,$maxCapacityLS);
my(@signLinkTp,$signLinkTpDN,@linkStateList,@slcList,@linkTpStatusList);
my(@signRouteSetNePart, @destList ,@lshbList, $signRouteSetNePartNum);
my($signRouteSetNeTpDN, @signRouteNePart, $signRouteNePartDN,$signRouteNePartNum,@prioList, @lsList);
my($ManagedIdDN);
my($mtpSignPointId14,$pointCode14, $networkIndicator14, $pointCodeLength14);
my($mtpSignPointId24,$pointCode24, $networkIndicator24, $pointCodeLength24);
my($signLinkSetTpDN14,$signLinkSetTpDN24,$maxCapacityLS);
my(@LS24,$spid24,%signLinkSetTp24,%adjPc24,$signLinkSetTp24Num,@signLinkSetTp24Id,$signLinkSetTp24IdNum,@adjPc14List);
my(@LS14,$spid14,%signLinkSetTp14,%adjPc14, $signLinkSetTp14Num,@signLinkSetTp14Id,$signLinkSetTp14IdNum,@adjPc24List);
my($mtpSignPoint14,$mtpSignPoint24,%signLinkTp14,%signLinkTp24,%slc14,%slc24, %linkState14,%linkState24, %linkTpStatus14,%linkTpStatus24);
my($signLinkTpDN14,$signLinkTpDN24,%signLinkTp14,%signLinkTp24);
my(@linkState14List,@linkState24List,@linkTpStatus14List,@linkTpStatus24List);
my($signRouteSetNePart24Num, $signRouteSetNePart14Num);
my(@dest14,@dest24,$spidRoute14,$spidRoute24,%signRouteSetNePart14,%signRouteSetNePart24,%signRouteNePart14,%signRouteNePart24);
my(%destList14, %destList24, %prioList14,%prioList24, %lshbList14,%lshbList24,%lsList14,%lsList24);
my($signRouteSetNeTpDN14,$signRouteSetNeTpDN24);
my($signRouteNePartNum14,$signRouteNePartNum24,@signRouteNePart14List,@signRouteNePart24List);
my(@lsList14List,@lsList24List,@prioList14List,@prioList24List);
my($signRouteNePartDN24,$signRouteNePartDN14);
my($signRouteSetNePartNum24,$signRouteSetNePartNum14);
my($SLC,@signLinkTp14Id,@signLinkTp24Id,$signLinkTp14IdNum,$signLinkTp24IdNum);
my($z,$linenew);
my($userLabel14,$userLabel24);
my($spType);
my($maxNumPdpAddress);
my(@linkTpStatus24new,@linkTpStatus14new);
my(@slcode14,@slcode24);

模本四:映射XML文件

    for($j=0; $j<$signLinkSetTp24Num; $j++){
        $signLinkSetTp24IdNum=0;
        @signLinkSetTp24Id=0;
        @adjPc24List=0;
        @signLinkSetTp24Id=split(/,/,$signLinkSetTp24{$LS24[$j]});
        $signLinkSetTp24IdNum=@signLinkSetTp24Id;
        @signLinkTp24Id=split(/,/,$signLinkTp24{$LS24[$j]});
        $signLinkTp24IdNum=@signLinkTp24Id;
        $maxCapacityLS=0.5*64000*$signLinkTp24IdNum;
        @linkState24List=split(/,/,$linkState24{$LS24[$j]});
        @linkTpStatus24List=split(/,/,$linkTpStatus24{$LS24[$j]});
        @slcode24=split(/,/,$slc24{$LS24[$j]});
        $signLinkSetTpDN24=$mtpSignPoint24.",SignLinkSetTp=".$signLinkSetTp24{$LS24[$j]};
        print exportFileHandle "\n";
        print exportFileHandle "$signLinkSetTpDN24\n";
        print exportFileHandle "\t\n";
        print exportFileHandle "\t\tsignLinkSetTpId\n";
        print exportFileHandle "\t\t$mtpSignPointId24:$signLinkSetTp24{$LS24[$j]}\n";
        print exportFileHandle "\t\tuserLabel\n";
        print exportFileHandle "\t\t$signLinkSetTp24{$LS24[$j]}\n";
        print exportFileHandle "\t\tadjPc\n";
        print exportFileHandle "\t\t$adjPc24{$LS24[$j]}\n";
        print exportFileHandle "\t\tmaxCapacityLS\n";
        print exportFileHandle "\t\t$maxCapacityLS\n";
        print exportFileHandle "\t\n";
        print exportFileHandle "\n";
        for($z=0; $z<$signLinkTp24IdNum; $z++){    
            $signLinkTpDN24=$signLinkSetTpDN24.",SignLinkTp=".$signLinkTp24Id[$z];
            print exportFileHandle "\n";
            print exportFileHandle "$signLinkTpDN24\n";
            print exportFileHandle "\t\n";
            print exportFileHandle "\t\tsignLinkTpId\n";
            print exportFileHandle "\t\t$signLinkTp24Id[$z]\n";
            print exportFileHandle "\t\tuserLabel\n";
            print exportFileHandle "\t\t$signLinkTp24Id[$z]\n";
            print exportFileHandle "\t\tadministrativeState\n";
            print exportFileHandle "\t\t$linkState24List[$z]\n";
            print exportFileHandle "\t\toperationalState\n";
            print exportFileHandle "\t\t$linkState24List[$z]\n";
            print exportFileHandle "\t\tslCode\n";
            print exportFileHandle "\t\t$slcode24[$z]\n";
            print exportFileHandle "\t\tlinkTpStatus\n";
            print exportFileHandle "\t\t$linkTpStatus24List[$z]\n";
            print exportFileHandle "\t\tmaxCapacitySL\n";
            print exportFileHandle "\t\t$maxCapacityLS\n";
            foreach $STkey (keys %ST){
                print "$ST{$STkey}\n";
                if ($STkey eq $signLinkTp24Id[$z]){
                    print exportFileHandle "\t\ttimeSlot\n";
                    print exportFileHandle "\t\t$timeslot{$ST{$STkey}}\n";         
                }
            }
            print exportFileHandle "\t\n";
            print exportFileHandle "\n";
        }
    }

阅读(1499) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~