The following are the steps for creating multiple XML files:
The language used to create the custom XML files is AutoIt.
SET UP TEMPLATE
In order to turn XML into AutoIt code, first export a template from the Azimuth Director II software and then open the file in your favorite text editor.
Copy the file to the clipboard using CTRL-A then CTRL-C
Double click readmodel2autoitcode.au3 located in C:\Documents and Settings\Administrator\Desktop\makexml
The AutoIt formatted XML code is now stored in the clipboard.
It is time to open up the makemodelmanual.au3 located in C:\Documents and Settings\Administrator\Desktop\makexml Open by right clicking and selecting SciTE editor.
The explanation will show how to edit gains.
Replace the current $value&= ... with the data in the clipboard by typing CTRL-V inside Func MakeModel($gain, $name)
Because we need to change certain values, we will need to edit this text slightly. AutoIt uses & to concatenate strings and values are specified as $value
Change the following lines:
$value&=' <MODEL_NAME>...</MODEL_NAME>' & @CRLF
with
$value&=' <MODEL_NAME>'&$name&$fileCount &'</MODEL_NAME>' & @CRLF
$value&=' <MODELGAIN>...</MODELGAIN>' & @CRLF
with
$value&=' <MODELGAIN>'&$gain[$fileCount] & '</MODELGAIN>' & @CRLF
INCLUDE CUSTOM GAINS
The following will explain how to AutoIT arrays to be used in the makemodelmanual.au3 from a matlab file.
Let's say that the matlab script create the matrices MG_sd, MG_sr, and MG_rd. At the bottom of the matlab file add the following:
fid = fopen('gains.txt','wt'); for i = 0: length(MG_sd.')-1 fprintf(fid,'$gainSD[%d] = %f\n', i, MG_sd(1,i+1)); end for i = 0: length(MG_sr.')-1 fprintf(fid,'$gainSR[%d] = %f\n', i, MG_sr(1,i+1)); end for i = 0: length(MG_rd.')-1 fprintf(fid,'$gainRD[%d] = %f\n', i, MG_rd(1,i+1)); end
These AutoIt arrays have been written to gains.txt
Open gain.txt and copy the files to the clipboard.
Go back to makemodelmanual.au3
Copy the values into the Func Gains
At the top change the Global $gainSD[], $gainRD[], and $gainSR[] to have the specified size for those files.