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

CPACS files with patch version are not processed #830

Closed
MarAlder opened this issue Sep 27, 2021 · 2 comments · Fixed by #847
Closed

CPACS files with patch version are not processed #830

MarAlder opened this issue Sep 27, 2021 · 2 comments · Fixed by #847
Milestone

Comments

@MarAlder
Copy link
Collaborator

If we have a CPACS version with patch number, the dataset will not open:

<header>
    <cpacsVersion>3.3.1</cpacsVersion>
</header>

basicWing.zip

grafik

grafik

@rainman110
Copy link
Collaborator

rainman110 commented Sep 27, 2021

The problem does not only exist in the cpacs schema (which was actually fixed for tigl) but also here in the tigl code:

https://github.com/DLR-SC/tigl/blob/master/src/api/tigl.cpp#L166

        ReturnCode tixiRet = tixiGetDoubleElement(tixiHandle, "/cpacs/header/cpacsVersion", &dcpacsVersion);
        if (tixiRet != SUCCESS) {
            // NO CPACS Version Information in Header
            if (tixiRet == ELEMENT_PATH_NOT_UNIQUE) {
                LOG(ERROR) << "Multiple CPACS version entries found. Please verify CPACS file.";
            }
            else if (tixiRet == ELEMENT_NOT_FOUND) {
                LOG(ERROR) << "No CPACS version information in file header. CPACS file seems to be too old.";
            }
            else {
                LOG(ERROR) << "Cannot read CPACS version,";
            }
            return TIGL_WRONG_CPACS_VERSION;
        }
        else {
            if (dcpacsVersion < (double) TIGL_MAJOR_VERSION) {
                LOG(ERROR) << "Too old CPACS dataset. CPACS version has to be at least " << (double) TIGL_MAJOR_VERSION << "!";
                return TIGL_WRONG_CPACS_VERSION;
            }
            else if (dcpacsVersion > atof(tiglGetVersion())) {
                LOG(WARNING) << "CPACS dataset version is higher than TIGL library version!";
            }
        }
    }

rainman110 added a commit that referenced this issue Nov 2, 2021
rainman110 added a commit that referenced this issue Nov 2, 2021
rainman110 added a commit that referenced this issue Nov 2, 2021
rainman110 added a commit that referenced this issue Nov 2, 2021
@MarAlder
Copy link
Collaborator Author

MarAlder commented Nov 2, 2021

Nice fix.

Edit: never mind (my previous post), it's restricted to the corresponding release version anyway... sorry

Thanks for the fix.

rainman110 added a commit that referenced this issue Nov 3, 2021
I also added more tests that check for
valid and invalid semantic versions.

Addresses #830
rainman110 added a commit that referenced this issue Nov 4, 2021
rainman110 added a commit that referenced this issue Nov 4, 2021
rainman110 added a commit that referenced this issue Nov 4, 2021
@rainman110 rainman110 added this to the TiGL 3.2.2 milestone Nov 8, 2021
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 a pull request may close this issue.

2 participants