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

detect SWMM version #18

Open
dleutnant opened this issue Aug 30, 2018 · 12 comments
Open

detect SWMM version #18

dleutnant opened this issue Aug 30, 2018 · 12 comments

Comments

@dleutnant
Copy link
Owner

No description provided.

@dickinsonre
Copy link

This is very important, do you mean from the binary file or the inp file?

@dleutnant
Copy link
Owner Author

Actually, I thought about detecting the most recent SWMM version installed to set the default path to the SWMM engine. But you're right: this would also be nice if we could estimate the SWMM version from both .inp and .out files.

@dleutnant
Copy link
Owner Author

dleutnant commented Aug 31, 2018

todo:

  • heuristic to detect available SWMM engines (OS specific)
  • determine SWMM version the .out file was generated with
  • determine SWMM version the .inp file was generated with

@dickinsonre
Copy link

The binary file version is shown at the top of the binary file
fseek(Fout.file, 0, SEEK_SET);
k = MAGICNUMBER;
fwrite(&k, sizeof(INT4), 1, Fout.file); // Magic number
k = VERSION;
fwrite(&k, sizeof(INT4), 1, Fout.file); // Version number
k = FlowUnits;
fwrite(&k, sizeof(INT4), 1, Fout.file); // Flow units

you can use the date of the swmm5.dll or swmm5.exe to determine the engine version but that will not work if you recompile it

it is easy to determine inp file versions by changes to the option section, unfortunately no all version have changes to the options section

@dleutnant
Copy link
Owner Author

Thank you, Robert!

@dickinsonre
Copy link

This is of limited help but i did do a blog about how you can use the options to find different versions of SWMM5. Unfortunately, most consecutive SWMM5 releases have the same options so this only yields three different "option" versions between 2014 and 2018
https://swmm5.org/2018/09/01/an-easy-test-for-swmm5-versions-using-the-status-report-message-for-unrecognized-keywords-in-past-swmm5-gui/

@dleutnant
Copy link
Owner Author

heuristic to detect available SWMM engines (OS specific) added in 0353e72

@dleutnant
Copy link
Owner Author

dleutnant commented Feb 25, 2019

function to determine the SWMM version the .out file was generated with is added in
f15df35

@dleutnant
Copy link
Owner Author

@dickinsonre Why the confused smiley?

@dickinsonre
Copy link

I was confused and used the wrong smiley!

@dleutnant
Copy link
Owner Author

dleutnant commented Feb 25, 2019

@dickinsonre From your blog post, I derive the following heuristic:

  1. Keywords RULE_STEP and SURCHARGED_METHOD were introduced in 5.1.013
  2. Keywords MINIMUM_STEP and THREADS were introduced in 5.1.008

Any idea what could bring us more information?

@dickinsonre
Copy link

There are a few other changes such as changes to the LID section and Weir sections (more data) but those only work if the user uses the new feature. If there is an output OUT file you could get the version number from the header of the binary file. It might be enough just to say that the input file works with the following versions of SWMM5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants