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

Multi-ASC files only supported in version 9.0.2 and not supported in later versions (Windows) #289

Open
barzottotec opened this issue May 19, 2023 · 3 comments

Comments

@barzottotec
Copy link

ASUS PRIME B250M-A{BOARDVIEW}.zip

Hello. I'm using Windows and trying to open the file "ASUS PRIME B250M-A{BOARDVIEW}" attached, I have the FZ keys, tried versions 9.95.0, 9.90.0, 9.0.3, the error message is:
There was an error opening the file: < path >
/home/piernov/devel/OpenBoardView/src/openboardview/FileFormats/ASCFile.cpp:60: ASCFile::parse_pin(char*&, char*&, char*&, char*&, line_iterator_t&)::<lambda()>: Assertion `value >= 0' failed.

OpenBoardView Multi-ASC Windows Error

Only version 9.0.2 opens the file normally.

By the way, it's not possible to copy the error message, I had to write it manually here.

@piernov
Copy link
Member

piernov commented May 19, 2023

Lines 6168-6175 and 6250-6257 of PINS.ASC , pins 59 to 66 of JM21 and JM22 all have missing properties. Not sure if it can only happen for this specific case. Would be quite tricky to handle in a general case (i.e. any missing property for any item).
Anyway, 20c971d on master already partially fixes this specific case as a side-effect but it'll still render unconnected pins at (0,0).

@barzottotec
Copy link
Author

barzottotec commented May 19, 2023 via email

@inflex
Copy link
Member

inflex commented May 20, 2023

In the ASCFile code where we parse the pin, we can resolve this issue by testing to see if p is not at the EOL.

The hiccup though will be that you'll need to read in the pin ID/number/name explicitly else the pin numbers will slip for each time we return early.

		pin.part = parts.size();
		pin.snum = READ_STR(); 
		pin.name = READ_STR();

		if ((*line_it) -p < 2) return;      // Test to see if p is too close to the EOL, if so, just move to next line.

		double posx = READ_DOUBLE();
		pin.pos.x   = posx * 1000.0f;
		double posy = READ_DOUBLE();

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

3 participants