| 1 | The following are the steps for creating multiple XML files: |
| 2 | |
| 3 | |
| 4 | |
| 5 | The language used to create the custom XML files is AutoIt. |
| 6 | |
| 7 | '''SET UP TEMPLATE''' |
| 8 | |
| 9 | 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. |
| 10 | |
| 11 | Copy the file to the clipboard using CTRL-A then CTRL-C |
| 12 | |
| 13 | Double click readmodel2autoitcode.au3 located in C:\Documents and Settings\Administrator\Desktop\makexml |
| 14 | |
| 15 | The AutoIt formatted XML code is now stored in the clipboard. |
| 16 | |
| 17 | It is time to open up the makemodelmanual.au3 located in C:\Documents and Settings\Administrator\Desktop\makexml |
| 18 | Open by right clicking and selecting SciTE editor. |
| 19 | |
| 20 | The explanation will show how to edit gains. |
| 21 | |
| 22 | Replace the current $value&= ... with the data in the clipboard by typing CTRL-V inside Func MakeModel($gain, $name) |
| 23 | |
| 24 | 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 |
| 25 | |
| 26 | Change the following lines: |
| 27 | |
| 28 | {{{ |
| 29 | $value&=' <MODEL_NAME>...</MODEL_NAME>' & @CRLF |
| 30 | }}} |
| 31 | |
| 32 | with |
| 33 | |
| 34 | {{{ |
| 35 | $value&=' <MODEL_NAME>'&$name&$fileCount &'</MODEL_NAME>' & @CRLF |
| 36 | }}} |
| 37 | |
| 38 | |
| 39 | {{{ |
| 40 | $value&=' <MODELGAIN>...</MODELGAIN>' & @CRLF |
| 41 | }}} |
| 42 | |
| 43 | with |
| 44 | |
| 45 | {{{ |
| 46 | $value&=' <MODELGAIN>'&$gain[$fileCount] & '</MODELGAIN>' & @CRLF |
| 47 | }}} |
| 48 | |
| 49 | |
| 50 | '''INCLUDE CUSTOM GAINS''' |
| 51 | |
| 52 | |
| 53 | The following will explain how to AutoIT arrays to be used in the makemodelmanual.au3 from a matlab file. |
| 54 | |
| 55 | 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: |
| 56 | |
| 57 | |
| 58 | {{{ |
| 59 | fid = fopen('gains.txt','wt'); |
| 60 | |
| 61 | for i = 0: length(MG_sd.')-1 |
| 62 | fprintf(fid,'$gainSD[%d] = %f\n', i, MG_sd(1,i+1)); |
| 63 | end |
| 64 | |
| 65 | for i = 0: length(MG_sr.')-1 |
| 66 | fprintf(fid,'$gainSR[%d] = %f\n', i, MG_sr(1,i+1)); |
| 67 | end |
| 68 | |
| 69 | for i = 0: length(MG_rd.')-1 |
| 70 | fprintf(fid,'$gainRD[%d] = %f\n', i, MG_rd(1,i+1)); |
| 71 | end |
| 72 | |
| 73 | }}} |
| 74 | |
| 75 | |
| 76 | These AutoIt arrays have been written to gains.txt |
| 77 | |
| 78 | Open gain.txt and copy the files to the clipboard. |
| 79 | |
| 80 | Go back to makemodelmanual.au3 |
| 81 | |
| 82 | Copy the values into the Func Gains |
| 83 | |
| 84 | At the top change the Global $gainSD[], $gainRD[], and $gainSR[] to have the specified size for those files. |
| 85 | |