Skip to content

Export Structured Text routine bodies - #68

Draft
santiagolgzz wants to merge 4 commits into
hutcheb:mainfrom
santiagolgzz:up/st-bodies-notes
Draft

santiagolgzz wants to merge 4 commits into
hutcheb:mainfrom
santiagolgzz:up/st-bodies-notes

Conversation

@santiagolgzz

Copy link
Copy Markdown

Depends on #67.

Building on #58: the decoder is available through st_decoder(), but the L5X export doesn't use it yet, so Structured Text routines come out empty. This fills them in, with each routine's lines in order.

On the three public ACDTests* files the routine matches the reference export line for line. If the decoder can't read a line, or a whole routine, a conversion note names the routine; it used to drop unreadable lines silently.

Fallbacks that skip or guess something now record a short plain-English
note as well as logging a warning: a controller tag left out, a
produced/consumed tag exported as Base, a guessed Region Map offset, an
unrecovered Region Map rung, and a routine with no readable type exported
as RLL. The notes are available as project.conversion_notes and written as
one XML comment at the top of the L5X; a fallback that hits many objects
gets one line naming the first few and a count. With no notes, the output
is unchanged.
When no unclaimed rung fits the gap, no rung is missing and nothing was
skipped or guessed, so it is logged but no longer noted.
ST routines were exported with Type="ST" and no content. Decode their
source with STDecoder while the database is built, store the lines in an
st_lines table keyed by the routine's object_id, and emit them as
<STContent><Line Number="n"> with CDATA text, as Studio 5000 does.

If decoding fails, the routines export with empty bodies and a warning
instead of the conversion aborting.
The decoder left out a line record whose text it could not read without
saying so. It now counts them per routine (STDecoder.unreadable_lines),
and the export records a conversion note naming each affected routine and
how many lines it lost.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant