Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This section reviews two examples of adding an app to the configuration file: a Python script and an executable; both with arguments.

Python File

Within the IASDK, there are several example scripts for connecting to the radar and retrieving some data.

To begin, it is recommended that the relevant files be copied into Trebuchet’s executable directory, in a folder called Apps. To do this:

  1. Create a folder called Apps in the trebuchet_debug folder:

    image-20241120-103027.pngImage Added

  2. Open the Apps folder and place the relevant applications that you wish to use via Trebuchet:

    image-20241120-103728.pngImage Added

  3. Open the the file appConfiguration.json:

    image-20241120-104017.pngImage Added

  4. and add a new entry to the TrebuchetApps list, in the following format:

    Code Block
    "TrebuchetApps": [
          <Current App list>,
        {
          "Name": "",
          "Description": "",
          "LaunchCommand": "",
          "ExePath": "",
          "ParameterGroups": [],
          "MutualExclusiveGroups": [],
          "ExecutionEnv": null
        }
    ]

Python File

Within the IASDK, there are several example scripts for connecting to the radar and retrieving some data.

For this example, they will be placed in <Trebuchet exe directory/Apps/Python/.

...

In this example, add the read_azimuth_of_fft_data.py script to the launcher. This is placed in Apps\Python\Python_radar_client\read_azimuth_of_fft_data.py. Set the name of the app to Read Single FFT Azimuth, and give an appropriate description. Since the “app” is a python script, we must provide a launch command. In this case, that command is python. Finally, set the ExePath field to Apps\\Python\\Python_radar_client\\read_azimuth_of_fft_data.py.

Note the double slash in the .exe path - this is required for Trebuchet to correctly parse the path.

The configuration entry will now look like this:

Code Block
     {
     
        "Name": "Read Single FFT Azimuth",
     
        "Description": "Connects to a radar and reads a single azimuth of data",
             "LaunchCommand": "python",
     
        "ExePath": "Apps\\Python\\Python_radar_client\\read_azimuth_of_fft_data.py”,
     py",
        "ParameterGroups": [
          {
            "GroupName": "",
            "Parameters": [
              {
                "ShortForm": "i",
                "LongForm": "ip_address",
                "Required": false,
                "HasArguments": true,
                "DefaultValue": "192.168.0.1"
              },
              {
                "ShortForm": "p",
                "LongForm": "port",
                "Required": false,
                "HasArguments": true,
                "DefaultValue": "6317"
              }
            ]
          }
        ],
     
        "MutualExclusiveGroups": [],
     
        "ExecutionEnv": null
         }

When the app is next launched, there will be a corresponding entry in the Trebuchet Launcher, but with no arguments:

...

So, the final configuration entry for this app looks like this:

Code Block
    {
             "Name": "Read Single FFT Azimuth",
             "Description": "Connects to a radar and reads a single azimuth of data",
             "LaunchCommand": "python",
             "ExePath": "Apps\\Python\\Python_radar_client\\read_azimuth_of_fft_data.py",
     
        "ParameterGroups": [
         
          {
         
            "GroupName": "",
         
            "Parameters": [
            {
             
              {
                "ShortForm": "i",
             
                "LongForm": "ip_address",
                             "Required": false,
             
                "HasArguments": true,
                "DefaultValue": "192.168.0.1",
              "HasArguments": true
            },
            {
             
              },
              {
                "ShortForm": "p",
             
                "LongForm": "port",
             
                "Required": false,
                             "HasArguments": true,
                "DefaultValue": "6317",
              "HasArguments": true
            }
             ]
        }
      ],
     
              }
            ]
          }
        ],
        "MutualExclusiveGroups": [],
             "ExecutionEnv": null
         }

This creates an entry in the Trebuchet app:

...