ci-server-engineer/examples/CI-Eng-Sample/17_printer_df.ps1
cliu 84228490dd Add report device, destination and three reports to CI-Eng-Sample
CIENG_FILE (file device built for the node at load time), CIENG_TANK1
(ad hoc with item parameter, daily 06:00), CIENG_INFLOW_HI (item trigger)
and CIENG_HTML (HTML, cursor loop, logbook). remove.cmd clears the
schedule first, since a scheduled report cannot be deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 16:17:02 +10:00

16 lines
962 B
PowerShell

# Build 17_printer_df.qli from 17_printer_df.tpl for this system (CI-Eng-Sample, CI Server R1.03.00).
# The printer device needs the CI Server node name ("<node>:FILE") and a literal output path,
# so they are filled in here: node name from LOCAL_NODE_DF, path from %TLS_LST_PATH%.
# Called by load.cmd; needs CI Server running.
$ErrorActionPreference = 'Stop'
Set-Location -LiteralPath $PSScriptRoot
$null = & dssqld -e 17_node.qlo -d LOCAL_NODE_DF -c
$node = $null
foreach ($row in (Import-Csv 17_node.qlo)) { if ($row.NAME -eq 'THIS_NODE') { $node = $row.NODE_NAME } }
Remove-Item 17_node.qlo
if (-not $node) { throw 'Node name not found in LOCAL_NODE_DF' }
$lst = $env:TLS_LST_PATH
if (-not $lst) { throw 'TLS_LST_PATH is not set' }
$text = (Get-Content -Raw 17_printer_df.tpl).Replace('<NODE>', $node).Replace('<LST>', $lst)
Set-Content -Encoding ascii -NoNewline -Path 17_printer_df.qli -Value $text
Write-Output "17_printer_df.qli: node $node, path $lst"