426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
|
%components = %component_id_tag;
$anon_id = 0;
while (($id, $component) = each(%components)) {
$component =~ s/\#//g;
($type, $name) = split (/:/, $component);
if (! $name) {
$component = "${component}:mtt${type}_${anon_id}";
}
$anon_id++;
$components{$id} = $component;
}
output_ibg_header();
|
|
|
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
|
%components = %component_id_tag;
$anon_id = 0;
while (($id, $component) = each(%components)) {
$component =~ s/\#//g;
($type, $name) = split (/:/, $component);
if (! $name) {
$component = "${component}:mtt${component}_${anon_id}";
}
$anon_id++;
$components{$id} = $component;
}
output_ibg_header();
|
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
|
my ($type, $attribute_node, $new_value )= @_;
my ($subnode);
$subnode = get_first_subnode_by_nodename_attribute(0,$attribute_node,$type);
$subnode->setAttribute(val => $new_value);
# return $subnode->getAttributeNode("val")->getValue;
}
sub get_arrow_info {
my ( $object_node, $id, $id_index )= @_;
my($attribute,$attributes);
$attribute = get_first_subnode_by_nodename_attribute(1,$object_node, "dia:attribute", "name", "arrow_on_start");
$bond_id_arrow_on_start{$id} = defined($attribute) ? get_dia_attribute_value("dia:boolean",$attribute) : 0;
$attribute = get_first_subnode_by_nodename_attribute(1,$object_node, "dia:attribute", "name", "effort_causality");
change_causality($id_index, $attribute, $change_effort_causality);
$bond_id_effort_causality{$id} = defined($attribute) ? get_dia_attribute_value("dia:enum",$attribute)-1 : 1;
$attribute = get_first_subnode_by_nodename_attribute(1,$object_node, "dia:attribute", "name", "flow_causality");
change_causality($id_index, $attribute, $change_flow_causality);
$bond_id_flow_causality{$id} = defined($attribute) ? get_dia_attribute_value("dia:enum",$attribute)-1 : 1;
# $attribute = get_first_subnode_by_nodename_attribute(1,$object_node, "dia:attribute", "name", "start_label");
# $bond_id_start_label{$id} = defined($attribute) ? get_dia_attribute_value("dia:string") : "[]";
$bond_id_start_label{$id} = "[]"; # FIXME!
# $attribute = get_first_subnode_by_nodename_attribute(1,$object_node, "dia:attribute", "name", "end_label");
# $bond_id_end_label{$id} = defined($attribute) ? get_dia_attribute_value("dia:string") : "[]";
$bond_id_end_label{$id} = "[]"; # FIXME!
}
sub change_causality() {
my ($id_index, $attribute_node, $causality_change_string)=@_;
my ($mtt_id, $arrow_oriented_causality);
foreach my $id_causality (split(/;/,$causality_change_string)) {
|
>
>
>
>
>
>
>
>
>
|
|
<
|
|
<
<
|
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
|
my ($type, $attribute_node, $new_value )= @_;
my ($subnode);
$subnode = get_first_subnode_by_nodename_attribute(0,$attribute_node,$type);
$subnode->setAttribute(val => $new_value);
# return $subnode->getAttributeNode("val")->getValue;
}
sub get_dia_attribute_string {
my ($attribute) = @_;
my ($str_elem, $string);
$str_elem = get_first_element_subnode($attribute);
$string = get_first_text_subnode($str_elem)->getData;
$string =~ s/\#//g;
return $string;
}
sub get_arrow_info {
my ( $object_node, $id, $id_index )= @_;
my($attribute,$attributes);
$attribute = get_first_subnode_by_nodename_attribute(1,$object_node, "dia:attribute", "name", "arrow_on_start");
$bond_id_arrow_on_start{$id} = defined($attribute) ? get_dia_attribute_value("dia:boolean",$attribute) : 0;
$attribute = get_first_subnode_by_nodename_attribute(1,$object_node, "dia:attribute", "name", "effort_causality");
change_causality($id_index, $attribute, $change_effort_causality);
$bond_id_effort_causality{$id} = defined($attribute) ? get_dia_attribute_value("dia:enum",$attribute)-1 : 1;
$attribute = get_first_subnode_by_nodename_attribute(1,$object_node, "dia:attribute", "name", "flow_causality");
change_causality($id_index, $attribute, $change_flow_causality);
$bond_id_flow_causality{$id} = defined($attribute) ? get_dia_attribute_value("dia:enum",$attribute)-1 : 1;
$attribute = get_first_subnode_by_nodename_attribute(1,$object_node, "dia:attribute", "name", "start_label");
$bond_id_start_label{$id} = defined($attribute) ? get_dia_attribute_string($attribute) : "[]";
$attribute = get_first_subnode_by_nodename_attribute(1,$object_node, "dia:attribute", "name", "end_label");
$bond_id_end_label{$id} = defined($attribute) ? get_dia_attribute_string($attribute) : "[]";
}
sub change_causality() {
my ($id_index, $attribute_node, $causality_change_string)=@_;
my ($mtt_id, $arrow_oriented_causality);
foreach my $id_causality (split(/;/,$causality_change_string)) {
|