Changeset 31759
- Timestamp:
- Jun 29, 2011, 8:40:03 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/perl/pspsSchema2xml.pl (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/perl/pspsSchema2xml.pl
r31279 r31759 48 48 } 49 49 50 open(WIKI, ">tables.wiki") or die("Error"); 51 50 52 my $enumsHeader = ucfirst($type)."BatchEnums"; 51 53 open(OUT, ">".$enumsHeader.".h") or die("Error"); … … 94 96 print OUT "\n#endif"; 95 97 close OUT; 98 close WIKI; 96 99 97 100 … … 193 196 parseTable("StackModelFit"); 194 197 parseTable("StackToImage"); 198 parseTable("SkinnyObject"); 199 parseTable("ObjectCalColor"); 195 200 } 196 201 … … 222 227 else {$tableNameOut = $tableName} 223 228 229 230 print WIKI "|| '''!".$tableNameOut."''' ||||||||||||||\n"; 231 print WIKI "|| '''ODM attribute''' || '''units''' || '''Data type''' || '''Default''' || '''Description''' || '''IPP source''' || '''IPP variable/notes''' ||\n"; 224 232 print OUT "\ntypedef enum {\n"; 225 233 $tablesWriter->startTag('table', "name" => $tableNameOut); … … 304 312 my $type; 305 313 my $comment; 314 my $fullComment; 306 315 my $default; 316 my $unit = "unknown"; 317 my $mstype = "unknown"; 307 318 308 319 # parse line … … 317 328 $comment =~ s/^[\s]*//; 318 329 $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)"; 320 332 } 321 333 # no comment case … … 325 337 $typeStr = $2; 326 338 $comment = "No comment"; 339 $fullComment = $comment; 327 340 } 328 341 else { … … 340 353 if ($typeStr =~ m/([a-zA-Z0-9()-]*)[ \t]+.*/) { 341 354 342 $type = $1; 355 $type = $1; 356 $mstype = $1; 343 357 $type =~ s/BIGINT/TLONGLONG/; 344 358 $type =~ s/SMALLINT/TSHORT/; … … 371 385 372 386 print OUT " ".uc($tableName)."_".uc($name)." = ".$colNum.",\n"; 387 print WIKI "|| ".$name."||".$unit."||".$mstype."||".$default."||".$comment."|| || ||\n"; 373 388 374 389 $tablesWriter->startTag('column', … … 376 391 "type" => $type, 377 392 "default" => $default, 378 "comment" => $ comment);393 "comment" => $fullComment); 379 394 $tablesWriter->endTag(); 380 395 … … 393 408 "name" => $name, 394 409 "arraysize" => $arraySize, 395 "datatype" => $votType); 410 "datatype" => $votType, 411 "unit" => $unit); 396 412 $votWriter->dataElement('DESCRIPTION', $comment); 397 413 $votWriter->endTag(); 398 414 399 $mapWriter->comment(" **MISSING** <map pspsName=\"$name\" ippType=\"$type\" ippName=\"\" comment=\"$ comment\"/>");415 $mapWriter->comment(" **MISSING** <map pspsName=\"$name\" ippType=\"$type\" ippName=\"\" comment=\"$fullComment\"/>"); 400 416 401 417 # $mapWriter->endTag();
Note:
See TracChangeset
for help on using the changeset viewer.
