our %Cmd; do 'db/Cmd.pm'; $ApidOffset = $Application{}{AppApidOffset}; foreach $cmd (keys %Cmd) { if (int($fssbCmd{$cmd}{fixed_pattern}) <= 15) { $opcode = sprintf("0%x",$Cmd{$cmd}{fixed_pattern}); } else { $opcode = sprintf("%x",$Cmd{$cmd}{fixed_pattern}); } $apid = sprintf("%x",$ApidBase+$ApidOffset); $cmdData{$cmd} = {opcode => "0x$opcode", apid => "0x$apid"}; }; #### %Cmd = ( 'command_1' => { _discussion => ' some text about command_1', description => ' shorter text about command_1', safety_level => 'SAFE', fixed_pattern => '143', constraints => undef, build_types => [ 'FLIGHT' ], cmd_id => 250033, target => 'command_target', Command_maps => [] }, 'command_2' => { _discussion => ' some text about command_2', description => ' shorter text about command_2', safety_level => 'SAFE', fixed_pattern => '144', constraints => undef, build_types => [ 'FLIGHT' ], cmd_id => 250014, target => 'command_target', Command_maps => [] } );