|
@@ -94,6 +94,16 @@ sub parse_module_file {
|
|
$last_proc_type = "output";
|
|
$last_proc_type = "output";
|
|
$module{'Outputs'}->{$output} = \%output_chars;
|
|
$module{'Outputs'}->{$output} = \%output_chars;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if ( $line =~ m/^-\ Button:(.*)/ ) {
|
|
|
|
+ my $button = $1;
|
|
|
|
+ $button = trim($button);
|
|
|
|
+ my %button_chars;
|
|
|
|
+ $last_input = $button;
|
|
|
|
+ $last_proc_type = "input";
|
|
|
|
+ $module{'Inputs'}->{$button} = \%button_chars;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
if ( $line =~ m/^--\ / ) {
|
|
if ( $line =~ m/^--\ / ) {
|
|
@@ -238,11 +248,11 @@ my %PARSE_RULES = (
|
|
$AST{'Sets'}->{$mod_to_set}->{$attr_to_set} = \%set_params;
|
|
$AST{'Sets'}->{$mod_to_set}->{$attr_to_set} = \%set_params;
|
|
};
|
|
};
|
|
|
|
|
|
- if ( $set_line =~ m/(^[A-Z]{1}[a-z]{1,})\.{1}([A-Za-z0-9]{1,})\ \=\ (.*)$/ ) {
|
|
|
|
|
|
+ if ( $set_line =~ m/(^[A-Z]{1}[A-Za-z]{1,})\.{1}([A-Za-z0-9]{1,})\ \=\ (.*)$/ ) {
|
|
$mod_to_set = $1;
|
|
$mod_to_set = $1;
|
|
$attr_to_set = $2;
|
|
$attr_to_set = $2;
|
|
$value = $3;
|
|
$value = $3;
|
|
- } elsif ( $set_line =~ m/(^[A-Z]{1}[a-z]{1,})\.{1}([A-Za-z0-9]{1,})\.([A-Za-z0-9]{1,})\ \=\ (.*)$/ ) {
|
|
|
|
|
|
+ } elsif ( $set_line =~ m/(^[A-Z]{1}[A-Za-z]{1,})\.{1}([A-Za-z0-9]{1,})\.([A-Za-z0-9]{1,})\ \=\ (.*)$/ ) {
|
|
$mod_to_set = $1;
|
|
$mod_to_set = $1;
|
|
$attr_to_set = $2;
|
|
$attr_to_set = $2;
|
|
$attr_param = $3;
|
|
$attr_param = $3;
|
|
@@ -302,7 +312,7 @@ my %PARSE_RULES = (
|
|
return 0;
|
|
return 0;
|
|
} else {
|
|
} else {
|
|
my $c = 0;
|
|
my $c = 0;
|
|
- foreach my $conn_id ( @{$AST{'Connections'}} ) {
|
|
|
|
|
|
+ foreach my $conn_id ( keys %{$AST{'Connections'}} ) {
|
|
$c++;
|
|
$c++;
|
|
}
|
|
}
|
|
return $c;
|
|
return $c;
|
|
@@ -379,11 +389,19 @@ sub module_node_constructor($$) {
|
|
graph => {label => "$$mod_ref{'Module'}"},
|
|
graph => {label => "$$mod_ref{'Module'}"},
|
|
node => {color => 'black', shape => 'circle'},
|
|
node => {color => 'black', shape => 'circle'},
|
|
);
|
|
);
|
|
- foreach my $node_name ( keys %{$mod_ref} ) {
|
|
|
|
- if ( $node_name =~ m/Module|Manufacturer|Rev/ ) {
|
|
|
|
- $graph->add_node(name => "$node_name : $$mod_ref{$node_name}", shape => 'oval');
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ # $graph->push_subgraph(
|
|
|
|
+ # name => "cluster_mod_info",
|
|
|
|
+ # graph => {label => "mod_info"},
|
|
|
|
+ # node => {color => 'grey', shape => 'square'},
|
|
|
|
+ # );
|
|
|
|
+ # foreach my $node_name ( keys %{$mod_ref} ) {
|
|
|
|
+ # if ( $node_name =~ m/Module|Manufacturer|Rev/ ) {
|
|
|
|
+ # $graph->add_node(name => "$node_name\n: $$mod_ref{$node_name}", shape => 'square');
|
|
|
|
+ # }
|
|
|
|
+ # }
|
|
|
|
+
|
|
|
|
+ # $graph->pop_subgraph;
|
|
|
|
|
|
if ( defined $AST{'Sets'}->{$$mod_ref{'Module'}} ) {
|
|
if ( defined $AST{'Sets'}->{$$mod_ref{'Module'}} ) {
|
|
my $sets_ref = $AST{'Sets'}->{$$mod_ref{'Module'}};
|
|
my $sets_ref = $AST{'Sets'}->{$$mod_ref{'Module'}};
|
|
@@ -393,7 +411,7 @@ sub module_node_constructor($$) {
|
|
$graph->push_subgraph(
|
|
$graph->push_subgraph(
|
|
name => $name,
|
|
name => $name,
|
|
graph => {label => $label},
|
|
graph => {label => $label},
|
|
- node => {color => "red", shape => 'square'},
|
|
|
|
|
|
+ node => {color => "green", shape => 'square'},
|
|
);
|
|
);
|
|
$graph->add_node(name => "$set : $$sets_ref{$set}->{'Param'} : $$sets_ref{$set}->{'Value'}");
|
|
$graph->add_node(name => "$set : $$sets_ref{$set}->{'Param'} : $$sets_ref{$set}->{'Value'}");
|
|
$graph->pop_subgraph;
|
|
$graph->pop_subgraph;
|
|
@@ -432,18 +450,16 @@ sub module_node_constructor($$) {
|
|
$graph->pop_subgraph;
|
|
$graph->pop_subgraph;
|
|
}
|
|
}
|
|
|
|
|
|
-sub connection_node_constructor($) {
|
|
|
|
- my $graph = shift;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
|
|
+# Draw modules
|
|
foreach my $mod_ref ( @{$AST{'Modules'}} ) {
|
|
foreach my $mod_ref ( @{$AST{'Modules'}} ) {
|
|
module_node_constructor($graph,$mod_ref);
|
|
module_node_constructor($graph,$mod_ref);
|
|
}
|
|
}
|
|
|
|
+
|
|
# Draw connections
|
|
# Draw connections
|
|
foreach my $conn_ref ( keys %{$AST{'Connections'}} ) {
|
|
foreach my $conn_ref ( keys %{$AST{'Connections'}} ) {
|
|
my $from = $AST{'Connections'}->{$conn_ref}->{'Output_Port'};
|
|
my $from = $AST{'Connections'}->{$conn_ref}->{'Output_Port'};
|
|
my $to = $AST{'Connections'}->{$conn_ref}->{'Input_Mod_Dst'};
|
|
my $to = $AST{'Connections'}->{$conn_ref}->{'Input_Mod_Dst'};
|
|
- $graph->add_edge(from => $from, to => $to);
|
|
|
|
|
|
+ $graph->add_edge(color => 'red', from => $from, to => $to);
|
|
}
|
|
}
|
|
|
|
|
|
my $format = 'svg';
|
|
my $format = 'svg';
|