Overview
Comment: | Handles repetitions (cmp.txt, ibg.m and abg.m) |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | origin/master | trunk |
Files: | files | file ages | folders |
SHA3-256: |
8882cbd39e591500bcc97360fe794180 |
User & Date: | geraint@users.sourceforge.net on 2004-08-02 06:55:01 |
Other Links: | branch diff | manifest | tags |
Context
2004-08-02
| ||
09:33:25 | Script to convert lbl.txt to cmp.m check-in: 487a38ee85 user: geraint@users.sourceforge.net tags: origin/master, trunk | |
06:55:01 | Handles repetitions (cmp.txt, ibg.m and abg.m) check-in: 8882cbd39e user: geraint@users.sourceforge.net tags: origin/master, trunk | |
2004-08-01
| ||
22:07:14 | Writes anonymous components (except junctions) to cmp.txt and then assigns names to them. check-in: a828e95287 user: geraint@users.sourceforge.net tags: origin/master, trunk | |
Changes
Modified mttroot/mtt/bin/trans/dia2abg.pl from [631b1db315] to [cf869a340e].
︙ | |||
88 89 90 91 92 93 94 95 96 97 98 99 100 101 | 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | + + | use XML::DOM; my (%component_id_tag, %bond_id_start_id, %bond_id_end_id, %component_label_data, $objects, %mtt_bond_id_index, %bond_id_arrow_on_start, %bond_id_flow_causality, %bond_id_effort_causality, %bond_id_start_label,%bond_id_end_label); my (%component_id_type, %component_id_name, %component_id_reps, %component_id_anon); # Parse user options: my $diagram_name = ''; my $dia_input_file = ''; my $dia_output_file = ''; my $label_file = ''; my $component_list_file = ''; my $debug = 0; |
︙ | |||
135 136 137 138 139 140 141 142 143 144 145 | 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | + - | my $dom = new XML::DOM::Parser; my ($doc); $doc = $dom->parsefile($dia_input_file); $objects = get_objects_node($doc,"Bond Graph"); get_component_data($objects); parse_component_data(); get_bond_data($objects); create_component_list() if ($create_component_list); |
︙ | |||
186 187 188 189 190 191 192 193 194 195 | 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | + + + + - + - - | sub create_component_list { my ($type, $name); print_debug("CREATING unique_raw_list...\n"); open (RAW,">$component_list_file") || die "Cannot open $component_list_file for writing.\n"; my (%reverse_component_id_tag) = reverse (%component_id_tag); foreach my $val (values(%component_id_tag)) { my ($id, $type); $id = $reverse_component_id_tag{$val}; $type = $component_id_type{$id}; $_ = $val; id_cleaner(); |
︙ | |||
346 347 348 349 350 351 352 | 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 | - - + + | } sub output_abg { my ($cr,$rep,$stat,$NM,$type,$arg,$bond_id,$start,$end,@clist,$connections, $strlength,$subsys_or_port); print_debug("WRITING OUTPUT TO STDIO...\n"); |
︙ | |||
429 430 431 432 433 434 435 | 433 434 435 436 437 438 439 440 441 442 443 444 445 446 | - | $head_label,$tail_label, $effort_causality,$flow_causality); output_ibg_header(); %reverse_mtt_bond_id_index = reverse (%mtt_bond_id_index); |
︙ | |||
457 458 459 460 461 462 463 | 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 | - - - - - - + + | if ($start_label !~ /\[.*\]/) { $start_label = "[]"; } if ($end_label !~ /\[.*\]/) { $end_label = "[]"; } |
︙ | |||
549 550 551 552 553 554 555 | 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 | - - - - + + + + + + + + + - + + - - + + + + + - - + + + + + | $str_elem = get_first_element_subnode($strattr); $string = get_first_text_subnode($str_elem); $component_id_tag{$id} = $string->getData; } die "There are no components!\n" unless keys(%component_id_tag) > 0; } |
︙ | |||
742 743 744 745 746 747 748 | 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 | - - - - - - - - - - - - - + + - - + | s/#?([^#]*)#?/$1/; } sub remove_brackets { s/^\[([^\]]*)\]$/$1/; } |
︙ |