XmlScriptInterpreter - HendriXML/KiCad-BOM-reporter GitHub Wiki

XmlScriptInterpreter

This is a Windows application developed by me in Delphi. The coding is with XML elements, structured similar like the Object Pascal language. Code is “compiled” in a single pass with XML SAX in an efficient way. After this execution is fast as well.

Because the base is XML the possibility to create extra “coding constructs” are endles. These are documented in XML schema’s and are used as a great way to make normally complex code more user friendly.

Scripts can define report targets, which are then mapped to RichText controls. In this way it is easy to create reports with (some) text formatting.

User interface

XmlScriptInterpreter

Select file... - button

Allows you to select an load a script file. Another way to to do this is to drag ‘n drop a script file on the form. Loading isn’t possible if a script is already running.

Load - button

Loads or reloads a script file.

Load and execute - button

Loads or reloads a script file, and execute it in one action.

Execute (resume) - button

Executes a script. Or when the script is suspended, resumes it.

Terminate - button

Sets a flag which can be checked in the script. Lengthly operations can be requested to be canceled this way.

Optimize - checkbox

When checked expressions will (partly) be resolved at loading time.

Simulation mode - checkbox

The state of this checkbox can be read with the IsSimulation function. When checked the script might not make real changes.

Verbose logging - checkbox

The state of this checkbox can be read with the IsVerbose function. When checked the script might output more information.

Close after execute - checkbox

When checked the application will end, when the script is done.

Close Windows after execute - checkbox

When checked Windows will shutdown, when the script finishes. This is done without asking the user to save unsaved document etc.

Pause - checkbox

The state of this checkbox can be read with the PauseRequest function. When checked the script might pause at certain points in the script.

Debug - checkbox

The state of this checkbox can be read with the IsDebugging function. When checked the script might change it’s behavior for debugging purposes.

Save report after execute - checkbox

When checked the report(s) are saved, without overwrite warnings to the given directory under the reports tab.

Reports - tab

A script may define many report targets, which will show as separate tabs within this tab control.

Input - tab

A way to pass a list of strings to the script. These are accessibele via an InputStrings function.

Config - tab

This shows a copy of the script config section, or the loaded ini file from the command line option. A new load always reloads the config section from the script file. Inif-file settings can be set here before the script is executed. These are accessible via a ConfigInifile function. Changed settings won’t be saved in the script file. Permanent changes must be done in the scriptfile itself.

Task selection - tab

When this tab is activated, the user has the possibility to select (sub)tasks which will be executed. Tasks (or category like tasks) may have required sub tasks, which will be selected also.

Command line options

XmlScriptInterpreter.exe <script-file> <options>

Options:
/Var <variable name> <variable value>
/ReportPath <directory name>
/AltConfig <ini-file>
/Execute
/CloseOnTerminate
/ShutDownOnTerminate
/StackInfo
/ActivateReportTarget <report target>

Option /StackInfo

Wraps every executable unit with a context reporting one, so a stacktrace can be shown when a exception occurs.

Option /Var

BomFilename <filename>

Unattended <tasks>
  tasks: Bom, BomEEVBlog, BomDokuWiki, BomDesignators, BomOrderPicking, Stock, StorageLocations, PartKeeprProjects
HideSpecs <specs>
   specs: ESerieOfValue, ResistorMaxAmpVolt, ZenerDiodeMaxAmp, Footprint
SheetInfo <details>
   details: None|Root|All
⚠️ **GitHub.com Fallback** ⚠️