|
VECTO Input Manager
|
This document covers use cases for the Job Creator Tool (job command) when working with JSON files and advanced component manipulation.
See also:
The user wants to create a new vehicle configuration from scratch without any existing files. The tool guides the user through an interactive process, displaying available vehicle types and prompting for each vehicle property with valid value ranges or enumerated options. The result is a JSON file containing the complete vehicle information, without any components.
Command example:
During the interactive session, the user is prompted to select the vehicle type from a list:
Based on the selected vehicle type, the tool prompts for each required vehicle property. Depending on the required data type, the tool shows valid ranges or enumerated options. Example prompts:
When all prompts are completed, the tool generates the vehicle job JSON file (new_vehicle.json).
💡 Read more about the interactive mode in the Interactive Mode Documentation.
The user has XML component files and wants to create a new vehicle by selecting a vehicle type interactively and incorporating these existing components. The tool validates that the components match the selected vehicle type, then guides the user through entering the remaining vehicle properties. The result is an intermediate vehicle job JSON file which can be used to create a complete VECTO job XML file with all components integrated.
Command example:
Assume the user would like to create a Heavy Lorry vehicle and has prepared several XML component files in the current folder:
The following command will start the interactive vehicle creation process, incorporating the existing components:
During the interactive session, the user is prompted to select the vehicle type from a list:
The user is then prompted for each required vehicle property. Depending on the required data type, the tool shows valid ranges or enumerated options. Example prompts:
Important: The -t vehicle flag disables interactive prompts for component data. However, for components that can appear multiple times (e.g., tyres for each axle, multiple powertrains), the tool will still prompt for the structure that holds these components (see the Interactive Mode Documentation).
For example, when creating a vehicle with multiple axles, you'll need to specify the axle configuration. The tool will then automatically assign the tyre components from the input files to each axle in file name order. Example prompt:
In the above input, we defined the two axles of the vehicle. The tool will then assign the tyre components from the input files to each axle in file name order.
After completing the interactive session, the tool generates the vehicle job JSON file (output.json). The user can then convert this to XML format using the following command:
The user has an existing vehicle XML file (Conventional_HeavyLorry.xml) or a JSON vehicle definition file (previously created) along with multiple XML component files. The user wants to combine the vehicle information with the component files to produce a complete VECTO job XML. The tool validates that all components are compatible with the vehicle type defined in the JSON file, then assembles them into a valid job file.
Command example:
The first command converts the vehicle XML to JSON. The second command combines the JSON vehicle information with component XML files to create a new vehicle job.
Note that some components are deeply nested into other placeholder objects, like tyres (for each axle), REESS, or even multiple gearboxes, retarders, etc. for multiple powertrain vehicles. In these cases, the vehicle JSON should be prepared with the placeholder objects and the component files will be used in ascending order.
In all cases of vehicle job generation, a *.report.txt file is created containing a detailed report of which components were used in the generation plus any other errors and/or warnings observed.
The user has a complete vehicle XML job file (Conventional_HeavyLorry.xml) that includes all components and vehicle properties. The user wants to extract only the vehicle structure and properties (without the actual component data) to a JSON file for easier editing. The tool creates a JSON file where all component references are set to null but the placeholder structure remains intact, making it compatible with subsequent component integration workflows even for complex vehicles.
Command example:
The --remove-components parameter will remove all components. The output, however, retains all structures that held the components. Example output:
This command also accepts a wildcard to convert multiple vehicles at once.
Afterwards, running the command vectoim job -i *.json -i *.xml -o output.xml and having components with file names such as: Components.Powertrain[1].IEPC.json, Components.Powertrain[0].Axlegear.json would recreate the original vehicle.
The user has a complete vehicle XML job file (Conventional_HeavyLorry.xml) and wants to extract each individual component (Engine, Gearbox, Tyres, etc.) as separate JSON files for easier inspection and editing. The tool validates the job XML, then saves each component as a JSON file with a descriptive filename that indicates the component type, its position in the vehicle structure, and any array indices where applicable.
Command example:
The user has an existing vehicle XML file (Conventional_HeavyLorry.xml) and wants to modify several properties without recreating the entire vehicle structure. The user creates a partial JSON file (modify.json) containing only the properties to be changed. The tool merges the modification file with the base vehicle file, applying the updates while preserving all other existing properties. Multiple modification files can be combined in sequence, with later files overriding earlier ones.
Command example:
The system processes input files in order, merging them into a single vehicle definition. Each subsequent file can override properties from previous files. This works with both XML and JSON inputs - you can start with an XML vehicle file and modify it with a JSON modification file.
Note: When modifying components that have valid signatures, the re-sign or clear validation action is required to allow modifications. Otherwise, an error will be raised.
Example modification file (modify.json):
Result: The output vehicle will have:
Advanced array manipulation: To remove all items from an array after a certain index, use "$crop": true:
This will keep only the first item in the RetarderLossMap array and remove all subsequent items.
The user has a complete vehicle XML job file (Conventional_HeavyLorry.xml) and wants to separate the vehicle structure from its components, modify them independently as JSON files for easier editing, and then reassemble everything into a new vehicle XML. This workflow demonstrates the full cycle of extraction, modification, and reconstruction using JSON as the intermediate format for maximum flexibility.
Goal:
Command sequence:
This creates the file Conventional_HeavyLorry.json
This creates the files: Components.Engine.json, Components.Gearbox.json, Components.TorqueConverter.json, Components.Angledrive.json, Components.Retarder.json, Components.Axlegear.json, Components.AxleWheels.Data.Axles[0].Tyre.json, Components.AxleWheels.Data.Axles[1].Tyre.json, Components.AirDrag.json.
Final output is modified_vehicle.xml along with modified_vehicle.report.txt containing details of the operation. Note that the Vehicle Job XML file will also have updated component signatures.
Use JSON workflow when:
Use XML workflow when:
Both workflows produce identical final results with valid VECTO job XML files.