Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readable pfs.write() output for non-unique-keyword pfs sections (e.g. in .plc) #570

Open
wu-hao-liang opened this issue May 12, 2023 · 2 comments

Comments

@wu-hao-liang
Copy link

For some pfs files with non-unique keywords, the output generated by mikeio.PfsDocument.write() is different from what produced by MIKE ZERO (pfs2004.dll)

Take the following plc files as an example ("ImageFileName","AxisUnit","PROPERTIES" are not unique keywords)
MIKE ZERO will write the pfs sections in a way like "Breadth-First Search" of the tree
PLC_MIKEZERO_pfs2004

mikeio will write the pfs sections in a way like "Detph-First Search" of the tree
PLC_MIKEIO_pfswrite

Both PLC files work normally producing a plot, but I hope the mikeio will write as the same style as MIKE ZERO.
This is more readable, and it can help when sometimes there is a need for people to read or revise PFS directly through a text editor.

This feature request is not urgent, but I hope it can be added in some later version.


I may submit my alternative solution of pfs.write() here later

@wu-hao-liang wu-hao-liang changed the title More readable pfs.write() output for non-unique-keyword pfs sections (e.g. in .plc) Readable pfs.write() output for non-unique-keyword pfs sections (e.g. in .plc) May 12, 2023
@ecomodeller
Copy link
Member

Thanks for pointing this out. Not sure what we can do about it.
In MIKE IO we are trying to model the structure of a PFS Document in a simplified way, which doesn't match 1:1 with the original document. Based on the syntax in the example, there is no way to detect which data belonging to each IMAGE_FILE, unless you have specific knowledge that this is a pfs file for PLC and each item starts with the line ImageFileName = ...

@wu-hao-liang
Copy link
Author

of a PFS Document in a simplified way,

Thanks. it might be better to be able to choose a simple output style or the MIKE-ZERO-LIKE style, especially for the non-unique keywords. The section in the screenshot is just an example, I mean keeping the same style in one PFS file is good enough, not need to detect the item or section.

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

No branches or pull requests

2 participants