IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31759


Ignore:
Timestamp:
Jun 29, 2011, 8:40:03 AM (15 years ago)
Author:
rhenders
Message:

now also exporting a wiki-table format file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/perl/pspsSchema2xml.pl

    r31279 r31759  
    4848}
    4949
     50open(WIKI, ">tables.wiki") or die("Error");
     51
    5052my $enumsHeader = ucfirst($type)."BatchEnums";
    5153open(OUT, ">".$enumsHeader.".h") or die("Error");
     
    9496print OUT "\n#endif";
    9597close OUT;
     98close WIKI;
    9699
    97100
     
    193196    parseTable("StackModelFit");
    194197    parseTable("StackToImage");
     198    parseTable("SkinnyObject");
     199    parseTable("ObjectCalColor");
    195200}
    196201
     
    222227    else {$tableNameOut = $tableName}
    223228
     229
     230    print WIKI "|| '''!".$tableNameOut."''' ||||||||||||||\n";
     231    print WIKI "|| '''ODM attribute''' || '''units''' || '''Data type''' || '''Default''' || '''Description''' || '''IPP source''' || '''IPP variable/notes''' ||\n";
    224232    print OUT "\ntypedef enum {\n";
    225233    $tablesWriter->startTag('table', "name" => $tableNameOut);
     
    304312    my $type;
    305313    my $comment;
     314    my $fullComment;
    306315    my $default;
     316    my $unit = "unknown";
     317    my $mstype = "unknown";
    307318
    308319    # parse line
     
    317328        $comment =~ s/^[\s]*//;
    318329        $comment =~ s/[\s]*$//;
    319         if ($comment =~ m/<column unit="(.*)">(.*)/ ) {$comment = "$2 (unit = $1)"}
     330        if ($comment =~ m/<column unit="(.*)">(.*)/ ) {$comment = $2; $unit = $1;}
     331        $fullComment = "$comment (unit = $unit)";
    320332    }
    321333    # no comment case
     
    325337        $typeStr = $2;
    326338        $comment = "No comment";
     339        $fullComment = $comment;
    327340    }
    328341    else {
     
    340353    if ($typeStr =~ m/([a-zA-Z0-9()-]*)[ \t]+.*/) {
    341354
    342         $type = $1;
     355        $type = $1;
     356        $mstype = $1;
    343357        $type =~ s/BIGINT/TLONGLONG/;
    344358        $type =~ s/SMALLINT/TSHORT/;
     
    371385
    372386    print OUT "  ".uc($tableName)."_".uc($name)." = ".$colNum.",\n";
     387    print WIKI "|| ".$name."||".$unit."||".$mstype."||".$default."||".$comment."|| || ||\n";
    373388
    374389    $tablesWriter->startTag('column',
     
    376391            "type" => $type,
    377392            "default" => $default,
    378             "comment" => $comment);
     393            "comment" => $fullComment);
    379394    $tablesWriter->endTag();
    380395
     
    393408            "name" => $name,
    394409            "arraysize" => $arraySize,
    395             "datatype" => $votType);
     410            "datatype" => $votType,
     411            "unit" => $unit);
    396412    $votWriter->dataElement('DESCRIPTION', $comment);
    397413    $votWriter->endTag();
    398414
    399     $mapWriter->comment(" **MISSING** <map pspsName=\"$name\" ippType=\"$type\" ippName=\"\" comment=\"$comment\"/>");
     415    $mapWriter->comment(" **MISSING** <map pspsName=\"$name\" ippType=\"$type\" ippName=\"\" comment=\"$fullComment\"/>");
    400416
    401417#    $mapWriter->endTag();
Note: See TracChangeset for help on using the changeset viewer.