xmlscripting:xmldb-en
Differences
This shows you the differences between two versions of the page.
— | xmlscripting:xmldb-en [2023/03/10 15:06] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== General XML Script Examples ====== | ||
+ | [[: | ||
+ | [[: | ||
+ | * [[: | ||
+ | * Examples: | ||
+ | * **[[: | ||
+ | |||
+ | |||
+ | \\ | ||
+ | Command Overview: [[http:// | ||
+ | \\ | ||
+ | \\ | ||
+ | =====Command Examples===== | ||
+ | | :!: The quotes on this page can not be used in XML. \\ ToDo: Prefix and suffix the examples with double % chars in the Wiki source. \\ Wrong: <lc id=" | ||
+ | \\ | ||
+ | |||
+ | ==== Loc Commands==== | ||
+ | ^ Within foreach table loops (no ID is required, its for all that match the conditions) ^ Within if or as single command outside a loop (ID is required)^ Remarks ^ | ||
+ | | %%<lc cmd=" | ||
+ | | <lc cmd=" | ||
+ | | <lc cmd=" | ||
+ | | <lc cmd=" | ||
+ | | <lc cmd=" | ||
+ | | <lc cmd=" | ||
+ | | <lc cmd=" | ||
+ | | <lc cmd=" | ||
+ | | <lc cmd=" | ||
+ | | -not available- (only one loc can be in a a block) | ||
+ | | -not available- (only one loc can be in a a block) | ||
+ | | <fn fnchanged=" | ||
+ | |||
+ | Commands: go, stop, velocity, velocity2, percent dispatch, swap, blockside, carcount, min, mid, cruise, max, consist, assigntrain, | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | |||
+ | ====Variables==== | ||
+ | ^ Within foreach table loops (Sub-ID required, its for all that match the conditions) ^ Within if (ID is required) ^ Remarks ^ | ||
+ | | <vr id=" | ||
+ | | <vr id=" | ||
+ | | <vr id=" | ||
+ | | <vr id=" | ||
+ | | <vr id=" | ||
+ | | <vr id=" | ||
+ | | <vr id=" | ||
+ | | <vr id=" | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | |||
+ | |||
+ | ====Classes==== | ||
+ | ^ Within foreach table loops (no ID is required, its for all that match the conditions) ^ Within if (ID is required) ^ Remarks ^ | ||
+ | | <lc cmd=" | ||
+ | | <lc cmd=" | ||
+ | | <bk cmd=" | ||
+ | | <bk cmd=" | ||
+ | | <bk cmd=" | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | ====Blocks==== | ||
+ | ^ Within foreach table loops (no ID is required, its for all that match the conditions) | ||
+ | | -not available- (a block can be reserved only for one loco) | <bk id=" | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | |||
+ | ====Sensors==== | ||
+ | ^ Within foreach table loops (no ID is required, its for all that match the conditions) | ||
+ | | -the availability need to clear- | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | |||
+ | ====Textboxes==== | ||
+ | ^ Within foreach table loops (no ID is required, its for all) ^ Within if (ID is required) ^ Remarks ^ | ||
+ | | -not availible- (changing a textbox within a loop doesn' | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | |||
+ | |||
+ | ====Sleep Command==== | ||
+ | ^ Within foreach table loops (sleep will be done every loop!) ^ Within if (ID is required) ^ Remarks ^ | ||
+ | | <sleep time=" | ||
+ | | <sleep time="# | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | |||
+ | =====Condition Examples===== | ||
+ | \\ | ||
+ | Examples for checking multiple conditions: | ||
+ | < | ||
+ | <if condition=" | ||
+ | <if condition=" | ||
+ | <if condition=" | ||
+ | </ | ||
+ | \\ | ||
+ | Examples for checking conditions, states and classes | ||
+ | < | ||
+ | <if condition="# | ||
+ | </ | ||
+ | \\ | ||
+ | \\ | ||
+ | Example for checking whole tables: | ||
+ | < | ||
+ | <foreach table=" | ||
+ | <foreach table=" | ||
+ | <foreach table=" | ||
+ | </ | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | |||
+ | =====Sub Scripts and Exit Script===== | ||
+ | \\ | ||
+ | To call a sub-script or to exit the actual script: | ||
+ | \\ | ||
+ | ^ XML ^ Remarks ^ | ||
+ | | <sub file=" | ||
+ | | <exit cmt=" | ||
+ | The cmt=“reason” can be used for tracing. | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | =====Loop Break===== | ||
+ | \\ | ||
+ | To leave a loop when a condition match: | ||
+ | \\ | ||
+ | ^ XML ^ Remarks ^ | ||
+ | | <break cmt=" | ||
+ | The cmt=“reason” can be used for tracing. | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | =====Action control===== | ||
+ | \\ | ||
+ | To call an existing Action if a condition is true | ||
+ | \\ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | Action " | ||
+ | To call an existing action several times from scripts with several conditions. | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | =====Operator and Car Commands===== | ||
+ | \\ | ||
+ | < | ||
+ | <car id=" | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | emptycar, loadcar, addcar, leavecar In the carids attribute a list of cars must be specified. | ||
+ | \\ | ||
+ | Car Commands: | ||
+ | \\ | ||
+ | Operator Commands: | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | =====System Commands===== | ||
+ | \\ | ||
+ | < | ||
+ | <sys cmd=" | ||
+ | </ | ||
+ | Commands: stoplocs, stop, go, shutdown, resume, on, off, ebreak, resetfx, time, v0locos, shortcut(short circuit) | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | |||
+ | =====Example Code===== | ||
+ | \\ | ||
+ | < | ||
+ | < | ||
+ | <sys cmd=" | ||
+ | <vr id=" | ||
+ | <tx id=" | ||
+ | <bk id=" | ||
+ | <vr id=" | ||
+ | <lc id=" | ||
+ | <car id=" | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | <if condition=" | ||
+ | < | ||
+ | <tx id=" | ||
+ | <lc id=" | ||
+ | <vr id=" | ||
+ | <tx id=" | ||
+ | <vr id=" | ||
+ | <vr id=" | ||
+ | </ | ||
+ | < | ||
+ | <sub file=" | ||
+ | <exit cmt=" | ||
+ | </ | ||
+ | </if> | ||
+ | <foreach table=" | ||
+ | <vr id=" | ||
+ | <break cmt=" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | |||