Subversion Repositories HomeAutomation

Rev

Rev 947 | Rev 965 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 947 Rev 950
Line 46... Line 46...
46
print MYFILE "//------------------ //\n";
46
print MYFILE "//------------------ //\n";
47
print MYFILE "\n";
47
print MYFILE "\n";
48
 
48
 
49
foreach my $class ($root->first_child('classes')->children('class'))
49
foreach my $class ($root->first_child('classes')->children('class'))
50
{
50
{
51
    my $className = "\U" . $class->att('name');
51
    my $className = $class->att('name');
52
    $className =~ tr/a-z/A-Z/;
52
    $className =~ tr/a-z/A-Z/;
53
    print MYFILE "#define CAN_MODULE_CLASS_$className " . $class->att('id') . "\n";
53
    print MYFILE "#define CAN_MODULE_CLASS_$className " . $class->att('id') . "\n";
54
}
54
}
55
 
55
 
56
print MYFILE "\n";
56
print MYFILE "\n";
Line 59... Line 59...
59
print MYFILE "//-------------------- //\n";
59
print MYFILE "//-------------------- //\n";
60
print MYFILE "\n";
60
print MYFILE "\n";
61
 
61
 
62
foreach my $command ($root->first_child('commands')->children('command'))
62
foreach my $command ($root->first_child('commands')->children('command'))
63
{
63
{
64
    my $commandName = "\U" . $command->att('name');
64
    my $commandName = $command->att('name');
65
    $commandName =~ tr/a-z/A-Z/;
65
    $commandName =~ tr/a-z/A-Z/;
66
    my $commandType = "\U" . $command->att('type');
66
    my $commandType = $command->att('type');
67
    $commandType =~ tr/a-z/A-Z/;
67
    $commandType =~ tr/a-z/A-Z/;
-
 
68
   
-
 
69
    if ($commandType eq "SPECIFIC")
-
 
70
    {
-
 
71
        $commandType = $command->att('module');
-
 
72
        $commandType =~ tr/a-z/A-Z/;
-
 
73
    }
-
 
74
   
68
    print MYFILE "#define CAN_MODULE_CMD_" . $commandType . "_" . $commandName . " " . $command->att('id') . "\n";
75
    print MYFILE "#define CAN_MODULE_CMD_" . $commandType . "_" . $commandName . " " . $command->att('id') . "\n";
69
}
76
}
70
 
77
 
71
print MYFILE "\n";
78
print MYFILE "\n";
72
print MYFILE "//------------------- //\n";
79
print MYFILE "//------------------- //\n";
Line 74... Line 81...
74
print MYFILE "//------------------- //\n";
81
print MYFILE "//------------------- //\n";
75
print MYFILE "\n";
82
print MYFILE "\n";
76
 
83
 
77
foreach my $module ($root->first_child('modules')->children('module'))
84
foreach my $module ($root->first_child('modules')->children('module'))
78
{
85
{
79
    my $className = "\U" . $module->att('class');
86
    my $className = $module->att('class');
80
    $className =~ tr/a-z/A-Z/;
87
    $className =~ tr/a-z/A-Z/;
81
    my $moduleName = "\U" . $module->att('name');
88
    my $moduleName = $module->att('name');
82
    $moduleName =~ tr/a-z/A-Z/;
89
    $moduleName =~ tr/a-z/A-Z/;
83
    print MYFILE "#define CAN_MODULE_TYPE_" . $className . "_" . $moduleName . " " . $module->att('id') . "\n";
90
    print MYFILE "#define CAN_MODULE_TYPE_" . $className . "_" . $moduleName . " " . $module->att('id') . "\n";
84
}
91
}
85
 
92
 
86
print MYFILE "\n";
93
print MYFILE "\n";
Line 89... Line 96...
89
print MYFILE "//----------------- //\n";
96
print MYFILE "//----------------- //\n";
90
print MYFILE "\n";
97
print MYFILE "\n";
91
 
98
 
92
foreach my $define ($root->first_child('defines')->children('define'))
99
foreach my $define ($root->first_child('defines')->children('define'))
93
{
100
{
94
    my $groupName = "\U" . $define->att('group');
101
    my $groupName = $define->att('group');
95
    $groupName =~ tr/a-z/A-Z/;
102
    $groupName =~ tr/a-z/A-Z/;
96
    my $defineName = "\U" . $define->att('name');
103
    my $defineName = $define->att('name');
97
    $defineName =~ tr/a-z/A-Z/;
104
    $defineName =~ tr/a-z/A-Z/;
98
    print MYFILE "#define " . $groupName . "_" . $defineName . " " . $define->att('id') . "\n";
105
    print MYFILE "#define " . $groupName . "_" . $defineName . " " . $define->att('id') . "\n";
99
}
106
}
100
 
107
 
101
print MYFILE "\n";
108
print MYFILE "\n";